From cbc5a4f608a6aad7c45dbef4538c089ee6d724b9 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 18 Jun 2026 15:55:57 +0530 Subject: [PATCH 1/6] Migrate v2022_02_01_preview consumers to shared arm_ml_service client Reuse the existing arm_ml_service generated client for the v2022_02_01_preview API surface instead of importing from the per-version restclient package, and delete azure/ai/ml/_restclient/v2022_02_01_preview/ (76 files). - _ml_client: wire the v2022_02_01_preview service client via a partial of MachineLearningServicesMgmtClient with api_version='2022-02-01-preview'. - Switch production imports (operations, entities, schema, utils) from azure.ai.ml._restclient.v2022_02_01_preview to azure.ai.ml._restclient.arm_ml_service and map the renamed hybrid models (JobBaseData -> JobBase, BatchDeploymentData -> BatchDeployment, OnlineEndpointData -> OnlineEndpoint, OnlineEndpointDetails -> OnlineEndpointProperties). - entities/_endpoint/online_endpoint.py: preserve the legacy 'endpoint' field on the wire via dict-style assignment since the new hybrid OnlineEndpointProperties model does not accept it as a constructor kwarg. - entities/_util.py: normalize_job_input_output_type now uses hard-coded camel-case keys ('Literal', 'UriFile', 'MlFlowModel', 'MlTable', ...) so it no longer depends on the v2022 generated JobInputType enum. The arm_ml_service JobInputType uses snake_case values and would silently break the v2022_02_01_preview payload normalization path that test_pipeline_component_entity / test_pipeline_job_entity exercise. - Update affected unit tests to import from arm_ml_service. - Delete the now-unused azure/ai/ml/_restclient/v2022_02_01_preview/ package. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 +- .../v2022_02_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 153 - .../v2022_02_01_preview/_configuration.py | 71 - .../v2022_02_01_preview/_metadata.json | 117 - .../_restclient/v2022_02_01_preview/_patch.py | 31 - .../v2022_02_01_preview/_vendor.py | 27 - .../v2022_02_01_preview/_version.py | 9 - .../v2022_02_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 149 - .../v2022_02_01_preview/aio/_configuration.py | 67 - .../v2022_02_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 43 - .../_batch_deployments_operations.py | 606 - .../operations/_batch_endpoints_operations.py | 632 - .../operations/_code_containers_operations.py | 312 - .../operations/_code_versions_operations.py | 339 - .../_component_containers_operations.py | 317 - .../_component_versions_operations.py | 344 - .../operations/_data_containers_operations.py | 317 - .../operations/_data_versions_operations.py | 353 - .../aio/operations/_datastores_operations.py | 404 - .../_environment_containers_operations.py | 317 - .../_environment_versions_operations.py | 344 - .../aio/operations/_jobs_operations.py | 450 - .../_model_containers_operations.py | 322 - .../operations/_model_versions_operations.py | 376 - .../_online_deployments_operations.py | 774 - .../_online_endpoints_operations.py | 840 - .../v2022_02_01_preview/models/__init__.py | 874 - ...azure_machine_learning_workspaces_enums.py | 931 - .../v2022_02_01_preview/models/_models.py | 13820 -------------- .../v2022_02_01_preview/models/_models_py3.py | 15054 ---------------- .../operations/__init__.py | 43 - .../_batch_deployments_operations.py | 837 - .../operations/_batch_endpoints_operations.py | 889 - .../operations/_code_containers_operations.py | 481 - .../operations/_code_versions_operations.py | 522 - .../_component_containers_operations.py | 489 - .../_component_versions_operations.py | 530 - .../operations/_data_containers_operations.py | 489 - .../operations/_data_versions_operations.py | 542 - .../operations/_datastores_operations.py | 633 - .../_environment_containers_operations.py | 489 - .../_environment_versions_operations.py | 530 - .../operations/_jobs_operations.py | 674 - .../_model_containers_operations.py | 497 - .../operations/_model_versions_operations.py | 580 - .../_online_deployments_operations.py | 1098 -- .../_online_endpoints_operations.py | 1195 -- .../_restclient/v2022_02_01_preview/py.typed | 1 - .../_deployment/online/online_deployment.py | 2 +- .../azure/ai/ml/_schema/_endpoint/endpoint.py | 2 +- .../_schema/_sweep/sweep_fields_provider.py | 2 +- .../ai/ml/_schema/_sweep/sweep_termination.py | 2 +- .../azure/ai/ml/_utils/_asset_utils.py | 2 +- .../ai/ml/entities/_builders/import_node.py | 4 +- .../ai/ml/entities/_deployment/deployment.py | 2 +- .../ml/entities/_endpoint/online_endpoint.py | 15 +- .../azure/ai/ml/entities/_job/import_job.py | 4 +- .../ml/entities/_job/parallel/parallel_job.py | 2 +- .../azure-ai-ml/azure/ai/ml/entities/_util.py | 18 +- .../azure/ai/ml/operations/_job_ops_helper.py | 7 +- .../ai/ml/operations/_local_job_invoker.py | 2 +- .../_online_deployment_operations.py | 2 +- .../operations/_online_endpoint_operations.py | 4 +- .../unittests/test_deployment_entity.py | 5 +- .../unittests/test_endpoint_entity.py | 10 +- sdk/ml/azure-ai-ml/tests/conftest.py | 2 +- .../unittests/test_online_endpoints.py | 12 +- 70 files changed, 53 insertions(+), 49024 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_metadata.json delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 052e6e760888..2fcd7093a582 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -25,7 +25,6 @@ from azure.ai.ml._restclient.v2020_09_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview, ) -from azure.ai.ml._restclient.v2022_02_01_preview import AzureMachineLearningWorkspaces as ServiceClient022022Preview from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022Preview from azure.ai.ml._restclient.v2023_02_01_preview import AzureMachineLearningWorkspaces as ServiceClient022023Preview from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview @@ -109,6 +108,7 @@ ServiceClient102022 = partial(MachineLearningServicesMgmtClient, api_version="2022-10-01") ServiceClient042023 = partial(MachineLearningServicesMgmtClient, api_version="2023-04-01") ServiceClient102023 = partial(MachineLearningServicesMgmtClient, api_version="2023-10-01") +ServiceClient022022Preview = partial(MachineLearningServicesMgmtClient, api_version="2022-02-01-preview") module_logger = logging.getLogger(__name__) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 0825110f9ef9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): - """AzureMachineLearningWorkspaces. - - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.operations.JobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.operations.OnlineDeploymentsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py deleted file mode 100644 index 673fbb94e319..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2022-02-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_metadata.json b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_metadata.json deleted file mode 100644 index effe63f67b8a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_metadata.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "chosen_version": "2022-02-01-preview", - "total_api_version_list": ["2022-02-01-preview"], - "client": { - "name": "AzureMachineLearningWorkspaces", - "filename": "_azure_machine_learning_workspaces", - "description": "AzureMachineLearningWorkspaces.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMachineLearningWorkspacesConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMachineLearningWorkspacesConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=\"https://management.azure.com\", # type: str", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "batch_endpoints": "BatchEndpointsOperations", - "batch_deployments": "BatchDeploymentsOperations", - "code_containers": "CodeContainersOperations", - "code_versions": "CodeVersionsOperations", - "component_containers": "ComponentContainersOperations", - "component_versions": "ComponentVersionsOperations", - "data_containers": "DataContainersOperations", - "data_versions": "DataVersionsOperations", - "datastores": "DatastoresOperations", - "environment_containers": "EnvironmentContainersOperations", - "environment_versions": "EnvironmentVersionsOperations", - "jobs": "JobsOperations", - "model_containers": "ModelContainersOperations", - "model_versions": "ModelVersionsOperations", - "online_endpoints": "OnlineEndpointsOperations", - "online_deployments": "OnlineDeploymentsOperations" - } -} \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 489f67bd1e79..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,149 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, Optional, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -from .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: - """AzureMachineLearningWorkspaces. - - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.aio.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.aio.operations.JobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.aio.operations.OnlineDeploymentsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py deleted file mode 100644 index 810db0bb39b5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2022-02-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py deleted file mode 100644 index a3a3e2ff32ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._jobs_operations import JobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations - -__all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 779b06cebbc0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,606 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchDeploymentsOperations: - """BatchDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.BatchDeploymentData": - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchDeploymentData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialTrackedResource", - **kwargs: Any - ) -> Optional["_models.BatchDeploymentData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeploymentData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialTrackedResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeploymentData"]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeploymentData or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeploymentData", - **kwargs: Any - ) -> "_models.BatchDeploymentData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeploymentData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeploymentData", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeploymentData"]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeploymentData or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index daa3a681bd08..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,632 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchEndpointsOperations: - """BatchEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.BatchEndpointData": - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchEndpointData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpointData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialBatchEndpointPartialTrackedResource", - **kwargs: Any - ) -> Optional["_models.BatchEndpointData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpointData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchEndpointPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialBatchEndpointPartialTrackedResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpointData"]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchEndpointPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpointData", - **kwargs: Any - ) -> "_models.BatchEndpointData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpointData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpointData", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpointData"]: - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpointData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index db15fbee09f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,312 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CodeContainerData": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CodeContainerData", - **kwargs: Any - ) -> "_models.CodeContainerData": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index dd78dbeec9e1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersionData": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.CodeVersionData", - **kwargs: Any - ) -> "_models.CodeVersionData": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 99514f21c10d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ComponentContainerData": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ComponentContainerData", - **kwargs: Any - ) -> "_models.ComponentContainerData": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 9908e7198437..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersionData": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ComponentVersionData", - **kwargs: Any - ) -> "_models.ComponentVersionData": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index 749296ff4fbe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainerData": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DataContainerData", - **kwargs: Any - ) -> "_models.DataContainerData": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index cde23f60d1ee..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,353 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBaseData": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DataVersionBaseData", - **kwargs: Any - ) -> "_models.DataVersionBaseData": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBaseData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 75233892dea4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,404 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DatastoresOperations: - """DatastoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.DatastoreResourceArmPaginatedResult"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DatastoreData": - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DatastoreData", - skip_validation: Optional[bool] = False, - **kwargs: Any - ) -> "_models.DatastoreData": - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DatastoreData - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DatastoreData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DatastoreData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DatastoreData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DatastoreSecrets": - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index 828587256d53..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainerData": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.EnvironmentContainerData", - **kwargs: Any - ) -> "_models.EnvironmentContainerData": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index 232982ef7b8f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersionData": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.EnvironmentVersionData", - **kwargs: Any - ) -> "_models.EnvironmentVersionData": - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 91e641c31434..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,450 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - scheduled: Optional[bool] = None, - schedule_id: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.JobBaseResourceArmPaginatedResult"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.JobBaseData": - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.JobBaseData", - **kwargs: Any - ) -> "_models.JobBaseData": - """Creates and executes a Job. - - Creates and executes a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBaseData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBaseData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBaseData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - - @distributed_trace_async - async def cancel( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Cancels a Job. - - Cancels a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_cancel_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - template_url=self.cancel.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index cc6f0064424e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,322 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ModelContainerData": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ModelContainerData", - **kwargs: Any - ) -> "_models.ModelContainerData": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 8af2fa2c3297..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,376 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersionData": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ModelVersionData", - **kwargs: Any - ) -> "_models.ModelVersionData": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index 58b8185691ea..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,774 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineDeploymentsOperations: - """OnlineDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.OnlineDeploymentData": - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineDeploymentData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialOnlineDeploymentPartialTrackedResource", - **kwargs: Any - ) -> Optional["_models.OnlineDeploymentData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeploymentData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialOnlineDeploymentPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialOnlineDeploymentPartialTrackedResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeploymentData"]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialOnlineDeploymentPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeploymentData or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeploymentData", - **kwargs: Any - ) -> "_models.OnlineDeploymentData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeploymentData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeploymentData", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeploymentData"]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeploymentData or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.DeploymentLogsRequest", - **kwargs: Any - ) -> "_models.DeploymentLogs": - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeploymentLogs, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index b660396ea34f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,840 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineEndpointsOperations: - """OnlineEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.OnlineEndpointData": - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineEndpointData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialOnlineEndpointPartialTrackedResource", - **kwargs: Any - ) -> Optional["_models.OnlineEndpointData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpointData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialOnlineEndpointPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialOnlineEndpointPartialTrackedResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpointData"]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialOnlineEndpointPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpointData", - **kwargs: Any - ) -> "_models.OnlineEndpointData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpointData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpointData", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpointData"]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore - - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - - @distributed_trace_async - async def get_token( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthToken": - """Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthToken, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py deleted file mode 100644 index c05abc0e06b5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py +++ /dev/null @@ -1,874 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AccountKeyDatastoreCredentials - from ._models_py3 import AccountKeyDatastoreSecrets - from ._models_py3 import AmlToken - from ._models_py3 import AssetBase - from ._models_py3 import AssetContainer - from ._models_py3 import AssetJobInput - from ._models_py3 import AssetJobOutput - from ._models_py3 import AssetReferenceBase - from ._models_py3 import AutoForecastHorizon - from ._models_py3 import AutoMLJob - from ._models_py3 import AutoMLVertical - from ._models_py3 import AutoNCrossValidations - from ._models_py3 import AutoSeasonality - from ._models_py3 import AutoTargetLags - from ._models_py3 import AutoTargetRollingWindowSize - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureFileDatastore - from ._models_py3 import BanditPolicy - from ._models_py3 import BatchDeploymentData - from ._models_py3 import BatchDeploymentDetails - from ._models_py3 import BatchDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import BatchEndpointData - from ._models_py3 import BatchEndpointDefaults - from ._models_py3 import BatchEndpointDetails - from ._models_py3 import BatchEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BuildContext - from ._models_py3 import CertificateDatastoreCredentials - from ._models_py3 import CertificateDatastoreSecrets - from ._models_py3 import Classification - from ._models_py3 import CodeConfiguration - from ._models_py3 import CodeContainerData - from ._models_py3 import CodeContainerDetails - from ._models_py3 import CodeContainerResourceArmPaginatedResult - from ._models_py3 import CodeVersionData - from ._models_py3 import CodeVersionDetails - from ._models_py3 import CodeVersionResourceArmPaginatedResult - from ._models_py3 import ColumnTransformer - from ._models_py3 import CommandJob - from ._models_py3 import CommandJobLimits - from ._models_py3 import ComponentContainerData - from ._models_py3 import ComponentContainerDetails - from ._models_py3 import ComponentContainerResourceArmPaginatedResult - from ._models_py3 import ComponentVersionData - from ._models_py3 import ComponentVersionDetails - from ._models_py3 import ComponentVersionResourceArmPaginatedResult - from ._models_py3 import ContainerResourceRequirements - from ._models_py3 import ContainerResourceSettings - from ._models_py3 import CronSchedule - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - from ._models_py3 import CustomNCrossValidations - from ._models_py3 import CustomSeasonality - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataContainerData - from ._models_py3 import DataContainerDetails - from ._models_py3 import DataContainerResourceArmPaginatedResult - from ._models_py3 import DataPathAssetReference - from ._models_py3 import DataSettings - from ._models_py3 import DataVersionBaseData - from ._models_py3 import DataVersionBaseDetails - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import DatastoreCredentials - from ._models_py3 import DatastoreData - from ._models_py3 import DatastoreDetails - from ._models_py3 import DatastoreResourceArmPaginatedResult - from ._models_py3 import DatastoreSecrets - from ._models_py3 import DefaultScaleSettings - from ._models_py3 import DeploymentLogs - from ._models_py3 import DeploymentLogsRequest - from ._models_py3 import DistributionConfiguration - from ._models_py3 import EarlyTerminationPolicy - from ._models_py3 import EndpointAuthKeys - from ._models_py3 import EndpointAuthToken - from ._models_py3 import EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointPropertiesBase - from ._models_py3 import EnvironmentContainerData - from ._models_py3 import EnvironmentContainerDetails - from ._models_py3 import EnvironmentContainerResourceArmPaginatedResult - from ._models_py3 import EnvironmentVersionData - from ._models_py3 import EnvironmentVersionDetails - from ._models_py3 import EnvironmentVersionResourceArmPaginatedResult - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import FeaturizationSettings - from ._models_py3 import FlavorData - from ._models_py3 import ForecastHorizon - from ._models_py3 import Forecasting - from ._models_py3 import ForecastingSettings - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import HdfsDatastore - from ._models_py3 import IdAssetReference - from ._models_py3 import IdentityConfiguration - from ._models_py3 import ImageClassification - from ._models_py3 import ImageClassificationBase - from ._models_py3 import ImageClassificationMultilabel - from ._models_py3 import ImageInstanceSegmentation - from ._models_py3 import ImageLimitSettings - from ._models_py3 import ImageModelDistributionSettings - from ._models_py3 import ImageModelDistributionSettingsClassification - from ._models_py3 import ImageModelDistributionSettingsObjectDetection - from ._models_py3 import ImageModelSettings - from ._models_py3 import ImageModelSettingsClassification - from ._models_py3 import ImageModelSettingsObjectDetection - from ._models_py3 import ImageObjectDetection - from ._models_py3 import ImageObjectDetectionBase - from ._models_py3 import ImageSweepLimitSettings - from ._models_py3 import ImageSweepSettings - from ._models_py3 import ImageVertical - from ._models_py3 import ImageVerticalDataSettings - from ._models_py3 import ImageVerticalValidationDataSettings - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import JobBaseData - from ._models_py3 import JobBaseDetails - from ._models_py3 import JobBaseResourceArmPaginatedResult - from ._models_py3 import JobInput - from ._models_py3 import JobLimits - from ._models_py3 import JobOutput - from ._models_py3 import JobService - from ._models_py3 import KerberosCredentials - from ._models_py3 import KerberosKeytabCredentials - from ._models_py3 import KerberosKeytabSecrets - from ._models_py3 import KerberosPasswordCredentials - from ._models_py3 import KerberosPasswordSecrets - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import LiteralJobInput - from ._models_py3 import MLFlowModelJobInput - from ._models_py3 import MLFlowModelJobOutput - from ._models_py3 import MLTableData - from ._models_py3 import MLTableJobInput - from ._models_py3 import MLTableJobOutput - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelContainerData - from ._models_py3 import ModelContainerDetails - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelVersionData - from ._models_py3 import ModelVersionDetails - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpVertical - from ._models_py3 import NlpVerticalDataSettings - from ._models_py3 import NlpVerticalFeaturizationSettings - from ._models_py3 import NlpVerticalLimitSettings - from ._models_py3 import NlpVerticalValidationDataSettings - from ._models_py3 import NoneDatastoreCredentials - from ._models_py3 import Objective - from ._models_py3 import OnlineDeploymentData - from ._models_py3 import OnlineDeploymentDetails - from ._models_py3 import OnlineDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineEndpointData - from ._models_py3 import OnlineEndpointDetails - from ._models_py3 import OnlineEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PartialAssetReferenceBase - from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialTrackedResource - from ._models_py3 import PartialBatchEndpoint - from ._models_py3 import PartialBatchEndpointPartialTrackedResource - from ._models_py3 import PartialBatchRetrySettings - from ._models_py3 import PartialCodeConfiguration - from ._models_py3 import PartialDataPathAssetReference - from ._models_py3 import PartialIdAssetReference - from ._models_py3 import PartialKubernetesOnlineDeployment - from ._models_py3 import PartialManagedOnlineDeployment - from ._models_py3 import PartialManagedServiceIdentity - from ._models_py3 import PartialOnlineDeployment - from ._models_py3 import PartialOnlineDeploymentPartialTrackedResource - from ._models_py3 import PartialOnlineEndpoint - from ._models_py3 import PartialOnlineEndpointPartialTrackedResource - from ._models_py3 import PartialOutputPathAssetReference - from ._models_py3 import PartialSku - from ._models_py3 import PipelineJob - from ._models_py3 import ProbeSettings - from ._models_py3 import PyTorch - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import RecurrencePattern - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import Regression - from ._models_py3 import Resource - from ._models_py3 import ResourceBase - from ._models_py3 import ResourceConfiguration - from ._models_py3 import Route - from ._models_py3 import SamplingAlgorithm - from ._models_py3 import SasDatastoreCredentials - from ._models_py3 import SasDatastoreSecrets - from ._models_py3 import ScheduleBase - from ._models_py3 import Seasonality - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - from ._models_py3 import Sku - from ._models_py3 import SkuCapacity - from ._models_py3 import SkuResource - from ._models_py3 import SkuResourceArmPaginatedResult - from ._models_py3 import SkuSetting - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import SweepJob - from ._models_py3 import SweepJobLimits - from ._models_py3 import SystemData - from ._models_py3 import TableVertical - from ._models_py3 import TableVerticalDataSettings - from ._models_py3 import TableVerticalFeaturizationSettings - from ._models_py3 import TableVerticalLimitSettings - from ._models_py3 import TableVerticalValidationDataSettings - from ._models_py3 import TargetLags - from ._models_py3 import TargetRollingWindowSize - from ._models_py3 import TargetUtilizationScaleSettings - from ._models_py3 import TensorFlow - from ._models_py3 import TestDataSettings - from ._models_py3 import TextClassification - from ._models_py3 import TextClassificationMultilabel - from ._models_py3 import TextNer - from ._models_py3 import TrackedResource - from ._models_py3 import TrainingDataSettings - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TritonModelJobInput - from ._models_py3 import TritonModelJobOutput - from ._models_py3 import TruncationSelectionPolicy - from ._models_py3 import UriFileDataVersion - from ._models_py3 import UriFileJobInput - from ._models_py3 import UriFileJobOutput - from ._models_py3 import UriFolderDataVersion - from ._models_py3 import UriFolderJobInput - from ._models_py3 import UriFolderJobOutput - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import UserIdentity - from ._models_py3 import ValidationDataSettings -except (SyntaxError, ImportError): - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AutoForecastHorizon # type: ignore - from ._models import AutoMLJob # type: ignore - from ._models import AutoMLVertical # type: ignore - from ._models import AutoNCrossValidations # type: ignore - from ._models import AutoSeasonality # type: ignore - from ._models import AutoTargetLags # type: ignore - from ._models import AutoTargetRollingWindowSize # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BatchDeploymentData # type: ignore - from ._models import BatchDeploymentDetails # type: ignore - from ._models import BatchDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchEndpointData # type: ignore - from ._models import BatchEndpointDefaults # type: ignore - from ._models import BatchEndpointDetails # type: ignore - from ._models import BatchEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import Classification # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainerData # type: ignore - from ._models import CodeContainerDetails # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersionData # type: ignore - from ._models import CodeVersionDetails # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import ColumnTransformer # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentContainerData # type: ignore - from ._models import ComponentContainerDetails # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentVersionData # type: ignore - from ._models import ComponentVersionDetails # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import ContainerResourceSettings # type: ignore - from ._models import CronSchedule # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import CustomNCrossValidations # type: ignore - from ._models import CustomSeasonality # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataContainerData # type: ignore - from ._models import DataContainerDetails # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataSettings # type: ignore - from ._models import DataVersionBaseData # type: ignore - from ._models import DataVersionBaseDetails # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreData # type: ignore - from ._models import DatastoreDetails # type: ignore - from ._models import DatastoreResourceArmPaginatedResult # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DefaultScaleSettings # type: ignore - from ._models import DeploymentLogs # type: ignore - from ._models import DeploymentLogsRequest # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EndpointAuthKeys # type: ignore - from ._models import EndpointAuthToken # type: ignore - from ._models import EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointPropertiesBase # type: ignore - from ._models import EnvironmentContainerData # type: ignore - from ._models import EnvironmentContainerDetails # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVersionData # type: ignore - from ._models import EnvironmentVersionDetails # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import FeaturizationSettings # type: ignore - from ._models import FlavorData # type: ignore - from ._models import ForecastHorizon # type: ignore - from ._models import Forecasting # type: ignore - from ._models import ForecastingSettings # type: ignore - from ._models import GridSamplingAlgorithm # type: ignore - from ._models import HdfsDatastore # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import ImageClassification # type: ignore - from ._models import ImageClassificationBase # type: ignore - from ._models import ImageClassificationMultilabel # type: ignore - from ._models import ImageInstanceSegmentation # type: ignore - from ._models import ImageLimitSettings # type: ignore - from ._models import ImageModelDistributionSettings # type: ignore - from ._models import ImageModelDistributionSettingsClassification # type: ignore - from ._models import ImageModelDistributionSettingsObjectDetection # type: ignore - from ._models import ImageModelSettings # type: ignore - from ._models import ImageModelSettingsClassification # type: ignore - from ._models import ImageModelSettingsObjectDetection # type: ignore - from ._models import ImageObjectDetection # type: ignore - from ._models import ImageObjectDetectionBase # type: ignore - from ._models import ImageSweepLimitSettings # type: ignore - from ._models import ImageSweepSettings # type: ignore - from ._models import ImageVertical # type: ignore - from ._models import ImageVerticalDataSettings # type: ignore - from ._models import ImageVerticalValidationDataSettings # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import JobBaseData # type: ignore - from ._models import JobBaseDetails # type: ignore - from ._models import JobBaseResourceArmPaginatedResult # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobService # type: ignore - from ._models import KerberosCredentials # type: ignore - from ._models import KerberosKeytabCredentials # type: ignore - from ._models import KerberosKeytabSecrets # type: ignore - from ._models import KerberosPasswordCredentials # type: ignore - from ._models import KerberosPasswordSecrets # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableData # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelContainerData # type: ignore - from ._models import ModelContainerDetails # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelVersionData # type: ignore - from ._models import ModelVersionDetails # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpVertical # type: ignore - from ._models import NlpVerticalDataSettings # type: ignore - from ._models import NlpVerticalFeaturizationSettings # type: ignore - from ._models import NlpVerticalLimitSettings # type: ignore - from ._models import NlpVerticalValidationDataSettings # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import Objective # type: ignore - from ._models import OnlineDeploymentData # type: ignore - from ._models import OnlineDeploymentDetails # type: ignore - from ._models import OnlineDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineEndpointData # type: ignore - from ._models import OnlineEndpointDetails # type: ignore - from ._models import OnlineEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PartialAssetReferenceBase # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialTrackedResource # type: ignore - from ._models import PartialBatchEndpoint # type: ignore - from ._models import PartialBatchEndpointPartialTrackedResource # type: ignore - from ._models import PartialBatchRetrySettings # type: ignore - from ._models import PartialCodeConfiguration # type: ignore - from ._models import PartialDataPathAssetReference # type: ignore - from ._models import PartialIdAssetReference # type: ignore - from ._models import PartialKubernetesOnlineDeployment # type: ignore - from ._models import PartialManagedOnlineDeployment # type: ignore - from ._models import PartialManagedServiceIdentity # type: ignore - from ._models import PartialOnlineDeployment # type: ignore - from ._models import PartialOnlineDeploymentPartialTrackedResource # type: ignore - from ._models import PartialOnlineEndpoint # type: ignore - from ._models import PartialOnlineEndpointPartialTrackedResource # type: ignore - from ._models import PartialOutputPathAssetReference # type: ignore - from ._models import PartialSku # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import PyTorch # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import RecurrencePattern # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import Regression # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import Route # type: ignore - from ._models import SamplingAlgorithm # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ScheduleBase # type: ignore - from ._models import Seasonality # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuResource # type: ignore - from ._models import SkuResourceArmPaginatedResult # type: ignore - from ._models import SkuSetting # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SystemData # type: ignore - from ._models import TableVertical # type: ignore - from ._models import TableVerticalDataSettings # type: ignore - from ._models import TableVerticalFeaturizationSettings # type: ignore - from ._models import TableVerticalLimitSettings # type: ignore - from ._models import TableVerticalValidationDataSettings # type: ignore - from ._models import TargetLags # type: ignore - from ._models import TargetRollingWindowSize # type: ignore - from ._models import TargetUtilizationScaleSettings # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TestDataSettings # type: ignore - from ._models import TextClassification # type: ignore - from ._models import TextClassificationMultilabel # type: ignore - from ._models import TextNer # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TrainingDataSettings # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import ValidationDataSettings # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - BatchLoggingLevel, - BatchOutputAction, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ContainerType, - CreatedByType, - CredentialsType, - DataType, - DatastoreType, - DeploymentProvisioningState, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EnvironmentType, - FeatureLags, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - InputDeliveryMode, - InstanceSegmentationPrimaryMetrics, - JobInputType, - JobLimitsType, - JobOutputType, - JobStatus, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LogVerbosity, - ManagedServiceIdentityType, - ModelSize, - ModelType, - NCrossValidationsMode, - ObjectDetectionPrimaryMetrics, - OperatingSystemType, - OrderString, - OutputDeliveryMode, - PublicNetworkAccessType, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModels, - RegressionPrimaryMetrics, - SamplingAlgorithmType, - ScaleType, - ScheduleStatus, - ScheduleType, - SeasonalityMode, - SecretsType, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - StackMetaLearnerType, - StochasticOptimizer, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - UseStl, - ValidationMetricType, - Weekday, -) - -__all__ = [ - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AmlToken', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeploymentData', - 'BatchDeploymentDetails', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpointData', - 'BatchEndpointDefaults', - 'BatchEndpointDetails', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'CodeConfiguration', - 'CodeContainerData', - 'CodeContainerDetails', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersionData', - 'CodeVersionDetails', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainerData', - 'ComponentContainerDetails', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersionData', - 'ComponentVersionDetails', - 'ComponentVersionResourceArmPaginatedResult', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CronSchedule', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainerData', - 'DataContainerDetails', - 'DataContainerResourceArmPaginatedResult', - 'DataPathAssetReference', - 'DataSettings', - 'DataVersionBaseData', - 'DataVersionBaseDetails', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatastoreCredentials', - 'DatastoreData', - 'DatastoreDetails', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DistributionConfiguration', - 'EarlyTerminationPolicy', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EnvironmentContainerData', - 'EnvironmentContainerDetails', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVersionData', - 'EnvironmentVersionDetails', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'GridSamplingAlgorithm', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepLimitSettings', - 'ImageSweepSettings', - 'ImageVertical', - 'ImageVerticalDataSettings', - 'ImageVerticalValidationDataSettings', - 'InferenceContainerProperties', - 'JobBaseData', - 'JobBaseDetails', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'KubernetesOnlineDeployment', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainerData', - 'ModelContainerDetails', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersionData', - 'ModelVersionDetails', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpVertical', - 'NlpVerticalDataSettings', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NlpVerticalValidationDataSettings', - 'NoneDatastoreCredentials', - 'Objective', - 'OnlineDeploymentData', - 'OnlineDeploymentDetails', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpointData', - 'OnlineEndpointDetails', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutputPathAssetReference', - 'PartialAssetReferenceBase', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialTrackedResource', - 'PartialBatchEndpoint', - 'PartialBatchEndpointPartialTrackedResource', - 'PartialBatchRetrySettings', - 'PartialCodeConfiguration', - 'PartialDataPathAssetReference', - 'PartialIdAssetReference', - 'PartialKubernetesOnlineDeployment', - 'PartialManagedOnlineDeployment', - 'PartialManagedServiceIdentity', - 'PartialOnlineDeployment', - 'PartialOnlineDeploymentPartialTrackedResource', - 'PartialOnlineEndpoint', - 'PartialOnlineEndpointPartialTrackedResource', - 'PartialOutputPathAssetReference', - 'PartialSku', - 'PipelineJob', - 'ProbeSettings', - 'PyTorch', - 'RandomSamplingAlgorithm', - 'RecurrencePattern', - 'RecurrenceSchedule', - 'RegenerateEndpointKeysRequest', - 'Regression', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'Route', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScheduleBase', - 'Seasonality', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'StackEnsembleSettings', - 'SweepJob', - 'SweepJobLimits', - 'SystemData', - 'TableVertical', - 'TableVerticalDataSettings', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TableVerticalValidationDataSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TestDataSettings', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TrackedResource', - 'TrainingDataSettings', - 'TrainingSettings', - 'TrialComponent', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'UserAssignedIdentity', - 'UserIdentity', - 'ValidationDataSettings', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LogVerbosity', - 'ManagedServiceIdentityType', - 'ModelSize', - 'ModelType', - 'NCrossValidationsMode', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OrderString', - 'OutputDeliveryMode', - 'PublicNetworkAccessType', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleStatus', - 'ScheduleType', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'StackMetaLearnerType', - 'StochasticOptimizer', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'UseStl', - 'ValidationMetricType', - 'Weekday', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 6aa656829a83..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,931 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ - - SUMMARY_ONLY = "SummaryOnly" - APPEND_ROW = "AppendRow" - -class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ - - #: Logistic regression is a fundamental classification technique. - #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear - #: regression. - #: Logistic regression is fast and relatively uncomplicated, and it's convenient for you to - #: interpret the results. - #: Although it's essentially a method for binary classification, it can also be applied to - #: multiclass problems. - LOGISTIC_REGRESSION = "LogisticRegression" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - SGD = "SGD" - #: The multinomial Naive Bayes classifier is suitable for classification with discrete features - #: (e.g., word counts for text classification). - #: The multinomial distribution normally requires integer feature counts. However, in practice, - #: fractional counts such as tf-idf may also work. - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - #: Naive Bayes classifier for multivariate Bernoulli models. - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - SVM = "SVM" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - #: Linear SVM performs best when input data is linear, i.e., data can be easily classified by - #: drawing the straight line between classified values on a plotted graph. - LINEAR_SVM = "LinearSVM" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the “bagging” - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - #: target column values can be divided into distinct class values. - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - #: Intersection Over Union. Intersection of predictions divided by union of predictions. - IOU = "IOU" - -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - -class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - STORAGE_INITIALIZER = "StorageInitializer" - INFERENCE_SERVER = "InferenceServer" - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_KEYTAB = "KerberosKeytab" - KERBEROS_PASSWORD = "KerberosPassword" - -class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - HDFS = "Hdfs" - -class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - ML_TABLE = "MLTable" - -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SCALING = "Scaling" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - -class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ - - AML_TOKEN = "AMLToken" - KEY = "Key" - AAD_TOKEN = "AADToken" - -class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ - - MANAGED = "Managed" - KUBERNETES = "Kubernetes" - AZURE_ML_COMPUTE = "AzureMLCompute" - -class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ - - #: No feature lags generated. - NONE = "None" - #: System auto-generates feature lags. - AUTO = "Auto" - -class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ - - #: Auto mode, system performs featurization without any custom featurization inputs. - AUTO = "Auto" - #: Custom featurization. - CUSTOM = "Custom" - #: Featurization off. 'Forecasting' task cannot use this value. - OFF = "Off" - -class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ - - #: Forecast horizon to be determined automatically. - AUTO = "Auto" - #: Use the custom forecast horizon. - CUSTOM = "Custom" - -class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ - - #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - #: statistical analysis to interpret the data and make future predictions. - #: This model aims to explain data by using time series data on its past values and uses linear - #: regression to make predictions. - AUTO_ARIMA = "AutoArima" - #: Prophet is a procedure for forecasting time series data based on an additive model where - #: non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. - #: It works best with time series that have strong seasonal effects and several seasons of - #: historical data. Prophet is robust to missing data and shifts in the trend, and typically - #: handles outliers well. - PROPHET = "Prophet" - #: The Naive forecasting model makes predictions by carrying forward the latest target value for - #: each time-series in the training data. - NAIVE = "Naive" - #: The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - #: target values for each time-series in the training data. - SEASONAL_NAIVE = "SeasonalNaive" - #: The Average forecasting model makes predictions by carrying forward the average of the target - #: values for each time-series in the training data. - AVERAGE = "Average" - #: The Seasonal Average forecasting model makes predictions by carrying forward the average value - #: of the latest season of data for each time-series in the training data. - SEASONAL_AVERAGE = "SeasonalAverage" - #: Exponential smoothing is a time series forecasting method for univariate data that can be - #: extended to support data with a systematic trend or seasonal component. - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - #: An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - #: viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - #: more moving average (MA) terms. - #: This method is suitable for forecasting when data is stationary/non stationary, and - #: multivariate with any type of data pattern, i.e., level/trend /seasonality/cyclicity. - ARIMAX = "Arimax" - #: TCNForecaster: Temporal Convolutional Networks Forecaster. //TODO: Ask forecasting team for - #: brief intro. - TCN_FORECASTER = "TCNForecaster" - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest"\\ it builds, is an ensemble of decision trees, usually trained with the - #: “bagging”\\ method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ - - #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - USER_IDENTITY = "UserIdentity" - -class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ - - LITERAL = "Literal" - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - ML_TABLE = "MLTable" - CUSTOM_MODEL = "CustomModel" - ML_FLOW_MODEL = "MLFlowModel" - TRITON_MODEL = "TritonModel" - -class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - ML_TABLE = "MLTable" - CUSTOM_MODEL = "CustomModel" - ML_FLOW_MODEL = "MLFlowModel" - TRITON_MODEL = "TritonModel" - -class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ - - #: Run hasn't started yet. - NOT_STARTED = "NotStarted" - #: Run has started. The user has a run ID. - STARTING = "Starting" - #: (Not used currently) It will be used if ES is creating the compute target. - PROVISIONING = "Provisioning" - #: The run environment is being prepared. - PREPARING = "Preparing" - #: The job is queued in the compute target. For example, in BatchAI the job is in queued state, - #: while waiting for all required nodes to be ready. - QUEUED = "Queued" - #: The job started to run in the compute target. - RUNNING = "Running" - #: Job is completed in the target. It is in output collection state now. - FINALIZING = "Finalizing" - #: Cancellation has been requested for the job. - CANCEL_REQUESTED = "CancelRequested" - #: Job completed successfully. This reflects that both the job itself and output collection states - #: completed successfully. - COMPLETED = "Completed" - #: Job failed. - FAILED = "Failed" - #: Following cancellation request, the job is now successfully canceled. - CANCELED = "Canceled" - #: When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - #: goes to NotResponding state. - #: NotResponding is the only state that is exempt from strict transition orders. A run can go from - #: NotResponding to any of the previous states. - NOT_RESPONDING = "NotResponding" - #: The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. - PAUSED = "Paused" - #: Default job status if not mapped to all other statuses. - UNKNOWN = "Unknown" - #: The job is in a scheduled state. Job is not in any active state. - SCHEDULED = "Scheduled" - -class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ - - AUTO_ML = "AutoML" - COMMAND = "Command" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - -class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - PRIMARY = "Primary" - SECONDARY = "Secondary" - -class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ - - #: No learning rate scheduler selected. - NONE = "None" - #: Cosine Annealing With Warmup. - WARMUP_COSINE = "WarmupCosine" - #: Step learning rate scheduler. - STEP = "Step" - -class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ - - #: No logs emitted. - NOT_SET = "NotSet" - #: Debug and above log statements logged. - DEBUG = "Debug" - #: Info and above log statements logged. - INFO = "Info" - #: Warning and above log statements logged. - WARNING = "Warning" - #: Error and above log statements logged. - ERROR = "Error" - #: Only critical statements logged. - CRITICAL = "Critical" - -class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ - - #: No value selected. - NONE = "None" - #: Small size. - SMALL = "Small" - #: Medium size. - MEDIUM = "Medium" - #: Large size. - LARGE = "Large" - #: Extra large size. - EXTRA_LARGE = "ExtraLarge" - -class ModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The async operation state. - """ - - CUSTOM_MODEL = "CustomModel" - ML_FLOW_MODEL = "MLFlowModel" - TRITON_MODEL = "TritonModel" - -class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ - - #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - #: task. - AUTO = "Auto" - #: Use custom N-Cross validations value. - CUSTOM = "Custom" - -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - -class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ - - RANDOM = "Random" - SOBOL = "Sobol" - -class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ - - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest"\\ it builds, is an ensemble of decision trees, usually trained with the - #: “bagging”\\ method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ - - #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe status of schedule - """ - - #: Schedule is enabled. - ENABLED = "Enabled" - #: Schedule is disabled. - DISABLED = "Disabled" - -class ScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe type of schedule - """ - - #: Cron schedule type. - CRON = "Cron" - #: Recurrence schedule type. - RECURRENCE = "Recurrence" - -class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ - - #: Seasonality to be determined automatically. - AUTO = "Auto" - #: Use the custom seasonality value. - CUSTOM = "Custom" - -class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - KERBEROS_PASSWORD = "KerberosPassword" - KERBEROS_KEYTAB = "KerberosKeytab" - -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - #: Do not use any identity for service data access. - NONE = "None" - #: Use the system assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - #: Use the user assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ - - #: Represents no/null value. - NONE = "None" - #: Short series will be padded if there are no long series, otherwise short series will be - #: dropped. - AUTO = "Auto" - #: All the short series will be padded. - PAD = "Pad" - #: All the short series will be dropped. - DROP = "Drop" - -class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ - - #: Automatically scales node count. - AUTOMATIC = "Automatic" - #: Node count scaled upon user request. - MANUAL = "Manual" - #: Fixed set of nodes. - NONE = "None" - -class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). - This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression - """ - - NONE = "None" - #: Default meta-learners are LogisticRegression for classification tasks. - LOGISTIC_REGRESSION = "LogisticRegression" - #: Default meta-learners are LogisticRegression for classification task when CV is on. - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - #: Default meta-learners are LogisticRegression for regression task. - ELASTIC_NET = "ElasticNet" - #: Default meta-learners are LogisticRegression for regression task when CV is on. - ELASTIC_NET_CV = "ElasticNetCV" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - LINEAR_REGRESSION = "LinearRegression" - -class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ - - #: No optimizer selected. - NONE = "None" - #: Stochastic Gradient Descent optimizer. - SGD = "Sgd" - #: Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - #: moments. - ADAM = "Adam" - #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. - ADAMW = "Adamw" - -class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ - - #: Represent no value set. - NONE = "None" - SUM = "Sum" - MAX = "Max" - MIN = "Min" - MEAN = "Mean" - -class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ - - #: Target lags to be determined automatically. - AUTO = "Auto" - #: Use the custom target lags. - CUSTOM = "Custom" - -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ - - #: Determine rolling windows size automatically. - AUTO = "Auto" - #: Use the specified rolling window size. - CUSTOM = "Custom" - -class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ - - #: Classification in machine learning and statistics is a supervised learning approach in which - #: the computer program learns from the data given to it and make new observations or - #: classifications. - CLASSIFICATION = "Classification" - #: Regression means to predict the value using the input data. Regression models are used to - #: predict a continuous value. - REGRESSION = "Regression" - #: Forecasting is a special kind of regression task that deals with time-series data and creates - #: forecasting model - #: that can be used to predict the near future values based on the inputs. - FORECASTING = "Forecasting" - #: Image Classification. Multi-class image classification is used when an image is classified with - #: only a single label - #: from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - #: or a 'duck'. - IMAGE_CLASSIFICATION = "ImageClassification" - #: Image Classification Multilabel. Multi-label image classification is used when an image could - #: have one or more labels - #: from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - #: Image Object Detection. Object detection is used to identify objects in an image and locate - #: each object with a - #: bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - #: Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - #: the pixel level, - #: drawing a polygon around each object in the image. - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - #: Text classification (also known as text tagging or text categorization) is the process of - #: sorting texts into categories. - #: Categories are mutually exclusive. - TEXT_CLASSIFICATION = "TextClassification" - #: Multilabel classification task assigns each sample to a group (zero or more) of target labels. - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - #: Text Named Entity Recognition a.k.a. TextNER. - #: Named Entity Recognition (NER) is the ability to take free-form text and identify the - #: occurrences of entities such as people, locations, organizations, and more. - TEXT_NER = "TextNER" - -class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ - - #: No stl decomposition. - NONE = "None" - SEASON = "Season" - SEASON_TREND = "SeasonTrend" - -class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ - - #: No metric. - NONE = "None" - #: Coco metric. - COCO = "Coco" - #: Voc metric. - VOC = "Voc" - #: CocoVoc metric. - COCO_VOC = "CocoVoc" - -class Weekday(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekdays - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py deleted file mode 100644 index 4ec94735e1b9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py +++ /dev/null @@ -1,13820 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class JobBaseDetails(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, PipelineJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseDetails, self).__init__(**kwargs) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseDetails' # type: str - self.schedule = kwargs.get('schedule', None) - self.services = kwargs.get('services', None) - self.status = None - - -class AutoMLJob(JobBaseDetails): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = None # type: Optional[str] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class DatastoreDetails(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(DatastoreDetails, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreDetails' # type: str - self.is_default = None - - -class AzureBlobDatastore(DatastoreDetails): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class AzureDataLakeGen1Datastore(DatastoreDetails): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - - -class AzureDataLakeGen2Datastore(DatastoreDetails): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class AzureFileDatastore(DatastoreDetails): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class BatchDeploymentData(TrackedResource): - """BatchDeploymentData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeploymentData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) - - -class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentDetails, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") - self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeploymentData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchEndpointData(TrackedResource): - """BatchEndpointData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpointData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointDetails(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointDetails, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpointData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - """ - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - """ - super(TableVertical, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar allowed_models: Allowed models for classification task. - :vartype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_models: Blocked models for classification task. - :vartype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword allowed_models: Allowed models for classification task. - :paramtype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_models: Blocked models for classification task. - :paramtype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(Classification, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) - self.task_type = 'Classification' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'Classification' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class CodeContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - super(CodeContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerDetails(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerDetails, self).__init__(**kwargs) - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - super(CodeVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionDetails(AssetBase): - """Code asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionDetails, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) - - -class CommandJob(JobBaseDetails): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - super(ComponentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerDetails(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerDetails, self).__init__(**kwargs) - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - super(ComponentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionDetails(AssetBase): - """Definition of a component version: defines resources that span component types. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionDetails, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) - - -class ScheduleBase(msrest.serialization.Model): - """Base definition of a schedule. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronSchedule, RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :vartype end_time: ~datetime.datetime - :ivar schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :vartype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar schedule_type: Required. [Required] Specifies the schedule type.Constant filled by - server. Possible values include: "Cron", "Recurrence". - :vartype schedule_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar start_time: Specifies start time of schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :vartype time_zone: str - """ - - _validation = { - 'schedule_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - } - - _subtype_map = { - 'schedule_type': {'Cron': 'CronSchedule', 'Recurrence': 'RecurrenceSchedule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :paramtype end_time: ~datetime.datetime - :keyword schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :paramtype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword start_time: Specifies start time of schedule in ISO 8601 format. - :paramtype start_time: ~datetime.datetime - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :paramtype time_zone: str - """ - super(ScheduleBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.schedule_status = kwargs.get('schedule_status', None) - self.schedule_type = None # type: Optional[str] - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - - -class CronSchedule(ScheduleBase): - """Cron schedule definition. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :vartype end_time: ~datetime.datetime - :ivar schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :vartype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar schedule_type: Required. [Required] Specifies the schedule type.Constant filled by - server. Possible values include: "Cron", "Recurrence". - :vartype schedule_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar start_time: Specifies start time of schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :vartype time_zone: str - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'schedule_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :paramtype end_time: ~datetime.datetime - :keyword schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :paramtype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword start_time: Specifies start time of schedule in ISO 8601 format. - :paramtype start_time: ~datetime.datetime - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronSchedule, self).__init__(**kwargs) - self.schedule_type = 'Cron' # type: str - self.expression = kwargs['expression'] - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'CustomModel' # type: str - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'CustomModel' # type: str - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class DataContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - super(DataContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerDetails(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "UriFile", "UriFolder", "MLTable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerDetails, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataSettings(msrest.serialization.Model): - """Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - """ - super(DataSettings, self).__init__(**kwargs) - self.target_column_name = kwargs['target_column_name'] - self.test_data = kwargs.get('test_data', None) - self.training_data = kwargs['training_data'] - - -class DatastoreData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails - """ - super(DatastoreData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DatastoreData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DatastoreData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DatastoreData] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataVersionBaseData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - super(DataVersionBaseData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseDetails(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'MLTable': 'MLTableData', 'UriFile': 'UriFileDataVersion', 'UriFolder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - """ - super(DataVersionBaseDetails, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str - self.data_uri = kwargs['data_uri'] - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) - - -class EnvironmentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - super(EnvironmentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerDetails(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerDetails, self).__init__(**kwargs) - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - super(EnvironmentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionDetails(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - """ - - _validation = { - 'environment_type': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - """ - super(EnvironmentVersionDetails, self).__init__(**kwargs) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar allowed_models: Allowed models for forecasting task. - :vartype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_models: Blocked models for forecasting task. - :vartype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword allowed_models: Allowed models for forecasting task. - :paramtype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_models: Blocked models for forecasting task. - :paramtype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - """ - super(Forecasting, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) - self.task_type = 'Forecasting' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'Forecasting' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class HdfsDatastore(DatastoreDetails): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - """ - super(ImageVertical, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', None) - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.split_ratio = kwargs.get('split_ratio', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :paramtype checkpoint_dataset_id: str - :keyword checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :paramtype checkpoint_filename: str - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: float - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_dataset_id = kwargs.get('checkpoint_dataset_id', None) - self.checkpoint_filename = kwargs.get('checkpoint_filename', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.split_ratio = kwargs.get('split_ratio', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :paramtype checkpoint_dataset_id: str - :keyword checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :paramtype checkpoint_filename: str - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: float - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :paramtype checkpoint_dataset_id: str - :keyword checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :paramtype checkpoint_filename: str - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: float - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - - -class ImageSweepLimitSettings(msrest.serialization.Model): - """Limit settings for model sweeping and hyperparameter sweeping. - - :ivar max_concurrent_trials: Maximum number of concurrent iterations for the underlying Sweep - job. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of iterations for the underlying Sweep job. - :vartype max_trials: int - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent iterations for the underlying - Sweep job. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of iterations for the underlying Sweep job. - :paramtype max_trials: int - """ - super(ImageSweepLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_trials = kwargs.get('max_trials', None) - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar limits: Required. [Required] Limit settings for model sweeping and hyperparameter - sweeping. - :vartype limits: ~azure.mgmt.machinelearningservices.models.ImageSweepLimitSettings - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'limits': {'required': True}, - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'limits': {'key': 'limits', 'type': 'ImageSweepLimitSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword limits: Required. [Required] Limit settings for model sweeping and hyperparameter - sweeping. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.ImageSweepLimitSettings - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.limits = kwargs['limits'] - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class ImageVerticalDataSettings(DataSettings): - """Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Settings for the validation dataset. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.ImageVerticalValidationDataSettings - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'ImageVerticalValidationDataSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :keyword validation_data: Settings for the validation dataset. - :paramtype validation_data: - ~azure.mgmt.machinelearningservices.models.ImageVerticalValidationDataSettings - """ - super(ImageVerticalDataSettings, self).__init__(**kwargs) - self.validation_data = kwargs.get('validation_data', None) - - -class ValidationDataSettings(msrest.serialization.Model): - """Validation settings. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ValidationDataSettings, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - - -class ImageVerticalValidationDataSettings(ValidationDataSettings): - """ImageVerticalValidationDataSettings. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVerticalValidationDataSettings, self).__init__(**kwargs) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class JobBaseData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails - """ - super(JobBaseData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBaseData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBaseData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBaseData] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) - - -class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): - """OnlineDeploymentDetails. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :vartype private_network_connection: bool - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :paramtype private_network_connection: bool - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentDetails, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentDetails' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.private_network_connection = kwargs.get('private_network_connection', False) - self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) - - -class KubernetesOnlineDeployment(OnlineDeploymentDetails): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :vartype private_network_connection: bool - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :paramtype private_network_connection: bool - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'Literal' # type: str - self.value = kwargs['value'] - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedOnlineDeployment(OnlineDeploymentDetails): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :vartype private_network_connection: bool - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :paramtype private_network_connection: bool - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'MLFlowModel' # type: str - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'MLFlowModel' # type: str - - -class MLTableData(DataVersionBaseDetails): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'MLTable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'MLTable' # type: str - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'MLTable' # type: str - - -class ModelContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - super(ModelContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerDetails(AssetContainer): - """ModelContainerDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerDetails, self).__init__(**kwargs) - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - super(ModelVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionDetails(AssetBase): - """Model asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. Possible values include: - "CustomModel", "MLFlowModel", "TritonModel". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.ModelType - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. Possible values include: - "CustomModel", "MLFlowModel", "TritonModel". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.ModelType - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - """ - super(ModelVersionDetails, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - """ - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - """ - super(NlpVertical, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - - -class NlpVerticalDataSettings(DataSettings): - """Class for data inputs. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'NlpVerticalValidationDataSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: - ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings - """ - super(NlpVerticalDataSettings, self).__init__(**kwargs) - self.validation_data = kwargs.get('validation_data', None) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(**kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', None) - - -class NlpVerticalValidationDataSettings(ValidationDataSettings): - """NlpVerticalValidationDataSettings. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(NlpVerticalValidationDataSettings, self).__init__(**kwargs) - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OnlineDeploymentData(TrackedResource): - """OnlineDeploymentData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeploymentData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeploymentData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineEndpointData(TrackedResource): - """OnlineEndpointData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpointData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineEndpointDetails(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointDetails, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpointData]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PartialAssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PartialDataPathAssetReference, PartialIdAssetReference, PartialOutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'PartialDataPathAssetReference', 'Id': 'PartialIdAssetReference', 'OutputPath': 'PartialOutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialAssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: - ~azure.mgmt.machinelearningservices.models.PartialCodeConfiguration - :ivar compute: Compute binding definition. - :vartype compute: str - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates number of processes per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.PartialAssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar retry_settings: Retry Settings for the batch inference operation. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.PartialBatchRetrySettings - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'PartialCodeConfiguration'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'PartialAssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'PartialBatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: - ~azure.mgmt.machinelearningservices.models.PartialCodeConfiguration - :keyword compute: Compute binding definition. - :paramtype compute: str - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates number of processes per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.PartialAssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword retry_settings: Retry Settings for the batch inference operation. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.PartialBatchRetrySettings - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.compute = kwargs.get('compute', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.error_threshold = kwargs.get('error_threshold', None) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', None) - self.mini_batch_size = kwargs.get('mini_batch_size', None) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', None) - self.properties = kwargs.get('properties', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialBatchEndpoint(msrest.serialization.Model): - """Mutable Batch endpoint configuration. - - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - - _attribute_map = { - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(PartialBatchEndpoint, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - - -class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchEndpoint - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchEndpoint - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialBatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(PartialBatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', None) - self.timeout = kwargs.get('timeout', None) - - -class PartialCodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'min_length': 1}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(PartialCodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs.get('scoring_script', None) - - -class PartialDataPathAssetReference(PartialAssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(PartialDataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class PartialIdAssetReference(PartialAssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(PartialIdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs.get('asset_id', None) - - -class PartialOnlineDeployment(msrest.serialization.Model): - """Mutable online deployment configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PartialKubernetesOnlineDeployment, PartialManagedOnlineDeployment. - - All required parameters must be populated in order to send to Azure. - - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'PartialKubernetesOnlineDeployment', 'Managed': 'PartialManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = None # type: Optional[str] - - -class PartialKubernetesOnlineDeployment(PartialOnlineDeployment): - """Properties specific to a KubernetesOnlineDeployment. - - All required parameters must be populated in order to send to Azure. - - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialKubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - - -class PartialManagedOnlineDeployment(PartialOnlineDeployment): - """Properties specific to a ManagedOnlineDeployment. - - All required parameters must be populated in order to send to Azure. - - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineDeployment - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineDeployment - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialOnlineDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialOnlineEndpoint(msrest.serialization.Model): - """Mutable online endpoint configuration. - - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _attribute_map = { - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(PartialOnlineEndpoint, self).__init__(**kwargs) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineEndpoint - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineEndpoint - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialOnlineEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialOutputPathAssetReference(PartialAssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(PartialOutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class PipelineJob(JobBaseDetails): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class RecurrencePattern(msrest.serialization.Model): - """Recurrence schedule pattern definition. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for recurrence schedule pattern. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for recurrence schedule pattern. - :vartype minutes: list[int] - :ivar weekdays: List of weekdays for recurrence schedule pattern. - :vartype weekdays: list[str or ~azure.mgmt.machinelearningservices.models.Weekday] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'weekdays': {'key': 'weekdays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for recurrence schedule pattern. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for recurrence schedule pattern. - :paramtype minutes: list[int] - :keyword weekdays: List of weekdays for recurrence schedule pattern. - :paramtype weekdays: list[str or ~azure.mgmt.machinelearningservices.models.Weekday] - """ - super(RecurrencePattern, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.weekdays = kwargs.get('weekdays', None) - - -class RecurrenceSchedule(ScheduleBase): - """Recurrence schedule definition. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :vartype end_time: ~datetime.datetime - :ivar schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :vartype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar schedule_type: Required. [Required] Specifies the schedule type.Constant filled by - server. Possible values include: "Cron", "Recurrence". - :vartype schedule_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar start_time: Specifies start time of schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :vartype time_zone: str - :ivar frequency: Required. [Required] Specifies frequency with with which to trigger schedule. - Possible values include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar pattern: Specifies the recurrence schedule pattern. - :vartype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern - """ - - _validation = { - 'schedule_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'pattern': {'key': 'pattern', 'type': 'RecurrencePattern'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :paramtype end_time: ~datetime.datetime - :keyword schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :paramtype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword start_time: Specifies start time of schedule in ISO 8601 format. - :paramtype start_time: ~datetime.datetime - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :paramtype time_zone: str - :keyword frequency: Required. [Required] Specifies frequency with with which to trigger - schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword pattern: Specifies the recurrence schedule pattern. - :paramtype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.schedule_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.pattern = kwargs.get('pattern', None) - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar allowed_models: Allowed models for regression task. - :vartype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_models: Blocked models for regression task. - :vartype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword allowed_models: Allowed models for regression task. - :paramtype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_models: Blocked models for regression task. - :paramtype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - """ - super(Regression, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) - self.task_type = 'Regression' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'Regression' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.resource_type = None - self.sku = kwargs.get('sku', None) - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) - - -class SweepJob(JobBaseDetails): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class TableVerticalDataSettings(DataSettings): - """Class for data inputs. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.TableVerticalValidationDataSettings - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'TableVerticalValidationDataSettings'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: - ~azure.mgmt.machinelearningservices.models.TableVerticalValidationDataSettings - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVerticalDataSettings, self).__init__(**kwargs) - self.validation_data = kwargs.get('validation_data', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar drop_columns: Columns to be dropped from data during featurization. - :vartype drop_columns: list[str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'drop_columns': {'key': 'dropColumns', 'type': '[str]'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword drop_columns: Columns to be dropped from data during featurization. - :paramtype drop_columns: list[str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.drop_columns = kwargs.get('drop_columns', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_trials = kwargs.get('max_trials', 1000) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") - - -class TableVerticalValidationDataSettings(ValidationDataSettings): - """Validation settings for AutoML Table vertical tasks - Classification/Regression/Forecasting. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - """ - super(TableVerticalValidationDataSettings, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TestDataSettings(msrest.serialization.Model): - """Test data inputs. - - :ivar data: Test data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Test data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - """ - super(TestDataSettings, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - self.test_data_size = kwargs.get('test_data_size', None) - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - """ - super(TextClassificationMultilabel, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - """ - super(TextNer, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - - -class TrainingDataSettings(msrest.serialization.Model): - """Training data input. - - All required parameters must be populated in order to send to Azure. - - :ivar data: Required. [Required] Training data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'data': {'required': True}, - } - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Required. [Required] Training data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TrainingDataSettings, self).__init__(**kwargs) - self.data = kwargs['data'] - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', False) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'TritonModel' # type: str - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'TritonModel' # type: str - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UriFileDataVersion(DataVersionBaseDetails): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'UriFile' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'UriFile' # type: str - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'UriFile' # type: str - - -class UriFolderDataVersion(DataVersionBaseDetails): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'UriFolder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'UriFolder' # type: str - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'UriFolder' # type: str - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py deleted file mode 100644 index ea53ffbdb36e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py +++ /dev/null @@ -1,15054 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, KerberosKeytabCredentials, KerberosPasswordCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, KerberosKeytabSecrets, KerberosPasswordSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class JobBaseDetails(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, PipelineJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - schedule: Optional["ScheduleBase"] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseDetails, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.identity = identity - self.is_archived = is_archived - self.job_type = 'JobBaseDetails' # type: str - self.schedule = schedule - self.services = services - self.status = None - - -class AutoMLJob(JobBaseDetails): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - *, - task_details: "AutoMLVertical", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - schedule: Optional["ScheduleBase"] = None, - services: Optional[Dict[str, "JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - resources: Optional["ResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = environment_id - self.environment_variables = environment_variables - self.outputs = outputs - self.resources = resources - self.task_details = task_details - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - *, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = log_verbosity - self.task_type = None # type: Optional[str] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class DatastoreDetails(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(DatastoreDetails, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreDetails' # type: str - self.is_default = None - - -class AzureBlobDatastore(DatastoreDetails): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = account_name - self.container_name = container_name - self.endpoint = endpoint - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class AzureDataLakeGen1Datastore(DatastoreDetails): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - - -class AzureDataLakeGen2Datastore(DatastoreDetails): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = account_name - self.endpoint = endpoint - self.filesystem = filesystem - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class AzureFileDatastore(DatastoreDetails): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureFile' # type: str - self.account_name = account_name - self.endpoint = endpoint - self.file_share_name = file_share_name - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class BatchDeploymentData(TrackedResource): - """BatchDeploymentData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchDeploymentDetails", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeploymentData, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.properties = properties - - -class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - error_threshold: Optional[int] = -1, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = 1, - mini_batch_size: Optional[int] = 10, - model: Optional["AssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = "predictions.csv", - resources: Optional["ResourceConfiguration"] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentDetails, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.compute = compute - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.provisioning_state = None - self.resources = resources - self.retry_settings = retry_settings - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeploymentData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchDeploymentData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchEndpointData(TrackedResource): - """BatchEndpointData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchEndpointDetails", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpointData, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = deployment_name - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.description = description - self.keys = keys - self.properties = properties - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointDetails(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointDetails, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.defaults = defaults - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpointData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchEndpointData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = 3, - timeout: Optional[datetime.timedelta] = "PT30S", - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - """ - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - } - - def __init__( - self, - *, - data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - training_settings: Optional["TrainingSettings"] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - """ - super(TableVertical, self).__init__(**kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.training_settings = training_settings - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar allowed_models: Allowed models for classification task. - :vartype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_models: Blocked models for classification task. - :vartype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - training_settings: Optional["TrainingSettings"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - allowed_models: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_models: Optional[List[Union[str, "ClassificationModels"]]] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword allowed_models: Allowed models for classification task. - :paramtype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_models: Blocked models for classification task. - :paramtype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(Classification, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, training_settings=training_settings, **kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.training_settings = training_settings - self.task_type = 'Classification' # type: str - self.allowed_models = allowed_models - self.blocked_models = blocked_models - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'Classification' # type: str - self.allowed_models = allowed_models - self.blocked_models = blocked_models - self.primary_metric = primary_metric - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class CodeContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, - } - - def __init__( - self, - *, - properties: "CodeContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails - """ - super(CodeContainerData, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerDetails(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, - } - - def __init__( - self, - *, - properties: "CodeVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails - """ - super(CodeVersionData, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionDetails(AssetBase): - """Code asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - *, - fields: Optional[List[str]] = None, - parameters: Optional[Any] = None, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = fields - self.parameters = parameters - - -class CommandJob(JobBaseDetails): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - schedule: Optional["ScheduleBase"] = None, - services: Optional[Dict[str, "JobService"]] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - resources: Optional["ResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails - """ - super(ComponentContainerData, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerDetails(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails - """ - super(ComponentVersionData, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionDetails(AssetBase): - """Definition of a component version: defines resources that span component types. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = container_resource_limits - self.container_resource_requests = container_resource_requests - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = cpu - self.gpu = gpu - self.memory = memory - - -class ScheduleBase(msrest.serialization.Model): - """Base definition of a schedule. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronSchedule, RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :vartype end_time: ~datetime.datetime - :ivar schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :vartype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar schedule_type: Required. [Required] Specifies the schedule type.Constant filled by - server. Possible values include: "Cron", "Recurrence". - :vartype schedule_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar start_time: Specifies start time of schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :vartype time_zone: str - """ - - _validation = { - 'schedule_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - } - - _subtype_map = { - 'schedule_type': {'Cron': 'CronSchedule', 'Recurrence': 'RecurrenceSchedule'} - } - - def __init__( - self, - *, - end_time: Optional[datetime.datetime] = None, - schedule_status: Optional[Union[str, "ScheduleStatus"]] = None, - start_time: Optional[datetime.datetime] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :paramtype end_time: ~datetime.datetime - :keyword schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :paramtype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword start_time: Specifies start time of schedule in ISO 8601 format. - :paramtype start_time: ~datetime.datetime - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :paramtype time_zone: str - """ - super(ScheduleBase, self).__init__(**kwargs) - self.end_time = end_time - self.schedule_status = schedule_status - self.schedule_type = None # type: Optional[str] - self.start_time = start_time - self.time_zone = time_zone - - -class CronSchedule(ScheduleBase): - """Cron schedule definition. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :vartype end_time: ~datetime.datetime - :ivar schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :vartype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar schedule_type: Required. [Required] Specifies the schedule type.Constant filled by - server. Possible values include: "Cron", "Recurrence". - :vartype schedule_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar start_time: Specifies start time of schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :vartype time_zone: str - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'schedule_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - expression: str, - end_time: Optional[datetime.datetime] = None, - schedule_status: Optional[Union[str, "ScheduleStatus"]] = None, - start_time: Optional[datetime.datetime] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :paramtype end_time: ~datetime.datetime - :keyword schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :paramtype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword start_time: Specifies start time of schedule in ISO 8601 format. - :paramtype start_time: ~datetime.datetime - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronSchedule, self).__init__(end_time=end_time, schedule_status=schedule_status, start_time=start_time, time_zone=time_zone, **kwargs) - self.schedule_type = 'Cron' # type: str - self.expression = expression - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'CustomModel' # type: str - self.description = description - self.job_input_type = 'CustomModel' # type: str - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'CustomModel' # type: str - self.description = description - self.job_output_type = 'CustomModel' # type: str - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - *, - values: List[int], - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = values - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class DataContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, - } - - def __init__( - self, - *, - properties: "DataContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails - """ - super(DataContainerData, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerDetails(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "UriFile", "UriFolder", "MLTable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataSettings(msrest.serialization.Model): - """Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - } - - def __init__( - self, - *, - target_column_name: str, - training_data: "TrainingDataSettings", - test_data: Optional["TestDataSettings"] = None, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - """ - super(DataSettings, self).__init__(**kwargs) - self.target_column_name = target_column_name - self.test_data = test_data - self.training_data = training_data - - -class DatastoreData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreDetails'}, - } - - def __init__( - self, - *, - properties: "DatastoreDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails - """ - super(DatastoreData, self).__init__(**kwargs) - self.properties = properties - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DatastoreData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DatastoreData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DatastoreData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DatastoreData] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataVersionBaseData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails - """ - super(DataVersionBaseData, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseDetails(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'MLTable': 'MLTableData', 'UriFile': 'UriFileDataVersion', 'UriFolder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - """ - super(DataVersionBaseDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str - self.data_uri = data_uri - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBaseData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = content - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - *, - container_type: Optional[Union[str, "ContainerType"]] = None, - tail: Optional[int] = None, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = container_type - self.tail = tail - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = primary_key - self.secondary_key = secondary_key - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = 0, - refresh_after_time_utc: Optional[int] = 0, - token_type: Optional[str] = None, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = access_token - self.expiry_time_utc = expiry_time_utc - self.refresh_after_time_utc = refresh_after_time_utc - self.token_type = token_type - - -class EnvironmentContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails - """ - super(EnvironmentContainerData, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerDetails(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails - """ - super(EnvironmentVersionData, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionDetails(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - """ - - _validation = { - 'environment_type': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - """ - super(EnvironmentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.inference_config = inference_config - self.os_type = os_type - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = dataset_language - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar allowed_models: Allowed models for forecasting task. - :vartype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_models: Blocked models for forecasting task. - :vartype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - training_settings: Optional["TrainingSettings"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - allowed_models: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_models: Optional[List[Union[str, "ForecastingModels"]]] = None, - forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword allowed_models: Allowed models for forecasting task. - :paramtype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_models: Blocked models for forecasting task. - :paramtype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, training_settings=training_settings, **kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.training_settings = training_settings - self.task_type = 'Forecasting' # type: str - self.allowed_models = allowed_models - self.blocked_models = blocked_models - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'Forecasting' # type: str - self.allowed_models = allowed_models - self.blocked_models = blocked_models - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "FeatureLags"]] = None, - forecast_horizon: Optional["ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, - target_lags: Optional["TargetLags"] = None, - target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[List[str]] = None, - use_stl: Optional[Union[str, "UseStl"]] = None, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = country_or_region_for_holidays - self.cv_step_size = cv_step_size - self.feature_lags = feature_lags - self.forecast_horizon = forecast_horizon - self.frequency = frequency - self.seasonality = seasonality - self.short_series_handling_config = short_series_handling_config - self.target_aggregate_function = target_aggregate_function - self.target_lags = target_lags - self.target_rolling_window_size = target_rolling_window_size - self.time_column_name = time_column_name - self.time_series_id_column_names = time_series_id_column_names - self.use_stl = use_stl - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class HdfsDatastore(DatastoreDetails): - """HdfsDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "Hdfs". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :vartype hdfs_server_certificate: str - :ivar name_node_address: Required. [Required] IP Address or DNS HostName. - :vartype name_node_address: str - :ivar protocol: Protocol used to communicate with the storage account (Https/Http). - :vartype protocol: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - name_node_address: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - hdfs_server_certificate: Optional[str] = None, - protocol: Optional[str] = "http", - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword hdfs_server_certificate: The TLS cert of the HDFS server. Needs to be a base64 encoded - string. Required if "Https" protocol is selected. - :paramtype hdfs_server_certificate: str - :keyword name_node_address: Required. [Required] IP Address or DNS HostName. - :paramtype name_node_address: str - :keyword protocol: Protocol used to communicate with the storage account (Https/Http). - :paramtype protocol: str - """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = hdfs_server_certificate - self.name_node_address = name_node_address - self.protocol = protocol - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - } - - def __init__( - self, - *, - data_settings: "ImageVerticalDataSettings", - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - """ - super(ImageVertical, self).__init__(**kwargs) - self.data_settings = data_settings - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - *, - data_settings: "ImageVerticalDataSettings", - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: "ImageVerticalDataSettings", - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) - self.data_settings = data_settings - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: "ImageVerticalDataSettings", - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) - self.data_settings = data_settings - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - *, - data_settings: "ImageVerticalDataSettings", - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: "ImageVerticalDataSettings", - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) - self.data_settings = data_settings - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - split_ratio: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.split_ratio = split_ratio - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - split_ratio: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - split_ratio: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_dataset_id: Optional[str] = None, - checkpoint_filename: Optional[str] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - split_ratio: Optional[float] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :paramtype checkpoint_dataset_id: str - :keyword checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :paramtype checkpoint_filename: str - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: float - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = advanced_settings - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.checkpoint_dataset_id = checkpoint_dataset_id - self.checkpoint_filename = checkpoint_filename - self.checkpoint_frequency = checkpoint_frequency - self.checkpoint_run_id = checkpoint_run_id - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.split_ratio = split_ratio - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_dataset_id: Optional[str] = None, - checkpoint_filename: Optional[str] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - split_ratio: Optional[float] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :paramtype checkpoint_dataset_id: str - :keyword checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :paramtype checkpoint_filename: str - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: float - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_dataset_id=checkpoint_dataset_id, checkpoint_filename=checkpoint_filename, checkpoint_frequency=checkpoint_frequency, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_dataset_id: Optional[str] = None, - checkpoint_filename: Optional[str] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - split_ratio: Optional[float] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :paramtype checkpoint_dataset_id: str - :keyword checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :paramtype checkpoint_filename: str - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :paramtype split_ratio: float - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_dataset_id=checkpoint_dataset_id, checkpoint_filename=checkpoint_filename, checkpoint_frequency=checkpoint_frequency, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: "ImageVerticalDataSettings", - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) - self.data_settings = data_settings - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - - -class ImageSweepLimitSettings(msrest.serialization.Model): - """Limit settings for model sweeping and hyperparameter sweeping. - - :ivar max_concurrent_trials: Maximum number of concurrent iterations for the underlying Sweep - job. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of iterations for the underlying Sweep job. - :vartype max_trials: int - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = None, - max_trials: Optional[int] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent iterations for the underlying - Sweep job. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of iterations for the underlying Sweep job. - :paramtype max_trials: int - """ - super(ImageSweepLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar limits: Required. [Required] Limit settings for model sweeping and hyperparameter - sweeping. - :vartype limits: ~azure.mgmt.machinelearningservices.models.ImageSweepLimitSettings - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'limits': {'required': True}, - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'limits': {'key': 'limits', 'type': 'ImageSweepLimitSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - limits: "ImageSweepLimitSettings", - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword limits: Required. [Required] Limit settings for model sweeping and hyperparameter - sweeping. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.ImageSweepLimitSettings - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.limits = limits - self.sampling_algorithm = sampling_algorithm - - -class ImageVerticalDataSettings(DataSettings): - """Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Settings for the validation dataset. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.ImageVerticalValidationDataSettings - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'ImageVerticalValidationDataSettings'}, - } - - def __init__( - self, - *, - target_column_name: str, - training_data: "TrainingDataSettings", - test_data: Optional["TestDataSettings"] = None, - validation_data: Optional["ImageVerticalValidationDataSettings"] = None, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :keyword validation_data: Settings for the validation dataset. - :paramtype validation_data: - ~azure.mgmt.machinelearningservices.models.ImageVerticalValidationDataSettings - """ - super(ImageVerticalDataSettings, self).__init__(target_column_name=target_column_name, test_data=test_data, training_data=training_data, **kwargs) - self.validation_data = validation_data - - -class ValidationDataSettings(msrest.serialization.Model): - """Validation settings. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ValidationDataSettings, self).__init__(**kwargs) - self.data = data - self.validation_data_size = validation_data_size - - -class ImageVerticalValidationDataSettings(ValidationDataSettings): - """ImageVerticalValidationDataSettings. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVerticalValidationDataSettings, self).__init__(data=data, validation_data_size=validation_data_size, **kwargs) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class JobBaseData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseDetails'}, - } - - def __init__( - self, - *, - properties: "JobBaseDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails - """ - super(JobBaseData, self).__init__(**kwargs) - self.properties = properties - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBaseData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBaseData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["JobBaseData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBaseData] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.port = port - self.properties = properties - self.status = None - - -class KerberosCredentials(msrest.serialization.Model): - """KerberosCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - """ - super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - - -class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosKeytabCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Keytab secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosKeytabSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Keytab secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets - """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets - - -class KerberosKeytabSecrets(DatastoreSecrets): - """KerberosKeytabSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_keytab: Kerberos keytab secret. - :vartype kerberos_keytab: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_keytab: Kerberos keytab secret. - :paramtype kerberos_keytab: str - """ - super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kerberos_keytab - - -class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): - """KerberosPasswordCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :vartype kerberos_kdc_address: str - :ivar kerberos_principal: Required. [Required] Kerberos Username. - :vartype kerberos_principal: str - :ivar kerberos_realm: Required. [Required] Domain over which a Kerberos authentication server - has the authority to authenticate a user, host or service. - :vartype kerberos_realm: str - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Kerberos password secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - - _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, - } - - def __init__( - self, - *, - kerberos_kdc_address: str, - kerberos_principal: str, - kerberos_realm: str, - secrets: "KerberosPasswordSecrets", - **kwargs - ): - """ - :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. - :paramtype kerberos_kdc_address: str - :keyword kerberos_principal: Required. [Required] Kerberos Username. - :paramtype kerberos_principal: str - :keyword kerberos_realm: Required. [Required] Domain over which a Kerberos authentication - server has the authority to authenticate a user, host or service. - :paramtype kerberos_realm: str - :keyword secrets: Required. [Required] Kerberos password secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets - """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) - self.kerberos_kdc_address = kerberos_kdc_address - self.kerberos_principal = kerberos_principal - self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets - - -class KerberosPasswordSecrets(DatastoreSecrets): - """KerberosPasswordSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar kerberos_password: Kerberos password secret. - :vartype kerberos_password: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): - """ - :keyword kerberos_password: Kerberos password secret. - :paramtype kerberos_password: str - """ - super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kerberos_password - - -class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): - """OnlineDeploymentDetails. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :vartype private_network_connection: bool - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - private_network_connection: Optional[bool] = False, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :paramtype private_network_connection: bool - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentDetails, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.app_insights_enabled = app_insights_enabled - self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentDetails' # type: str - self.instance_type = instance_type - self.liveness_probe = liveness_probe - self.model = model - self.model_mount_path = model_mount_path - self.private_network_connection = private_network_connection - self.provisioning_state = None - self.readiness_probe = readiness_probe - self.request_settings = request_settings - self.scale_settings = scale_settings - - -class KubernetesOnlineDeployment(OnlineDeploymentDetails): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :vartype private_network_connection: bool - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - private_network_connection: Optional[bool] = False, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :paramtype private_network_connection: bool - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, private_network_connection=private_network_connection, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = container_resource_requirements - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'Literal' # type: str - self.value = value - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedOnlineDeployment(OnlineDeploymentDetails): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :vartype private_network_connection: bool - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - private_network_connection: Optional[bool] = False, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword private_network_connection: If true, enable private network connection. - DEPRECATED for future API versions. Use EgressPublicNetworkAccess. - :paramtype private_network_connection: bool - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, private_network_connection=private_network_connection, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'MLFlowModel' # type: str - self.description = description - self.job_input_type = 'MLFlowModel' # type: str - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'MLFlowModel' # type: str - self.description = description - self.job_output_type = 'MLFlowModel' # type: str - - -class MLTableData(DataVersionBaseDetails): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'MLTable' # type: str - self.referenced_uris = referenced_uris - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'MLTable' # type: str - self.description = description - self.job_input_type = 'MLTable' # type: str - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'MLTable' # type: str - self.description = description - self.job_output_type = 'MLTable' # type: str - - -class ModelContainerData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, - } - - def __init__( - self, - *, - properties: "ModelContainerDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails - """ - super(ModelContainerData, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerDetails(AssetContainer): - """ModelContainerDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainerData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelVersionData(Resource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, - } - - def __init__( - self, - *, - properties: "ModelVersionDetails", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails - """ - super(ModelVersionData, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionDetails(AssetBase): - """Model asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. Possible values include: - "CustomModel", "MLFlowModel", "TritonModel". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.ModelType - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - job_name: Optional[str] = None, - model_type: Optional[Union[str, "ModelType"]] = None, - model_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. Possible values include: - "CustomModel", "MLFlowModel", "TritonModel". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.ModelType - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - """ - super(ModelVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersionData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - """ - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - } - - def __init__( - self, - *, - data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - """ - super(NlpVertical, self).__init__(**kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - - -class NlpVerticalDataSettings(DataSettings): - """Class for data inputs. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'NlpVerticalValidationDataSettings'}, - } - - def __init__( - self, - *, - target_column_name: str, - training_data: "TrainingDataSettings", - test_data: Optional["TestDataSettings"] = None, - validation_data: Optional["NlpVerticalValidationDataSettings"] = None, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: - ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings - """ - super(NlpVerticalDataSettings, self).__init__(target_column_name=target_column_name, test_data=test_data, training_data=training_data, **kwargs) - self.validation_data = validation_data - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class NlpVerticalValidationDataSettings(ValidationDataSettings): - """NlpVerticalValidationDataSettings. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(NlpVerticalValidationDataSettings, self).__init__(data=data, validation_data_size=validation_data_size, **kwargs) - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OnlineDeploymentData(TrackedResource): - """OnlineDeploymentData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineDeploymentDetails", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeploymentData, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeploymentData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineDeploymentData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineEndpointData(TrackedResource): - """OnlineEndpointData. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointDetails - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineEndpointDetails", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointDetails - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpointData, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineEndpointDetails(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointDetails, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.compute = compute - self.mirror_traffic = mirror_traffic - self.provisioning_state = None - self.public_network_access = public_network_access - self.traffic = traffic - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpointData]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineEndpointData"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: The maximum amount of time a request will stay in the queue in ISO 8601 - format. - Defaults to 500ms. - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - max_queue_wait: Optional[datetime.timedelta] = "PT0.5S", - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: The maximum amount of time a request will stay in the queue in ISO - 8601 format. - Defaults to 500ms. - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.max_queue_wait = max_queue_wait - self.request_timeout = request_timeout - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PartialAssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PartialDataPathAssetReference, PartialIdAssetReference, PartialOutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'PartialDataPathAssetReference', 'Id': 'PartialIdAssetReference', 'OutputPath': 'PartialOutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialAssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: - ~azure.mgmt.machinelearningservices.models.PartialCodeConfiguration - :ivar compute: Compute binding definition. - :vartype compute: str - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates number of processes per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.PartialAssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar retry_settings: Retry Settings for the batch inference operation. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.PartialBatchRetrySettings - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'PartialCodeConfiguration'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'PartialAssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'PartialBatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["PartialCodeConfiguration"] = None, - compute: Optional[str] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - error_threshold: Optional[int] = None, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = None, - mini_batch_size: Optional[int] = None, - model: Optional["PartialAssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - retry_settings: Optional["PartialBatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: - ~azure.mgmt.machinelearningservices.models.PartialCodeConfiguration - :keyword compute: Compute binding definition. - :paramtype compute: str - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID of the environment specification for the endpoint - deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates number of processes per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.PartialAssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword retry_settings: Retry Settings for the batch inference operation. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.PartialBatchRetrySettings - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.compute = compute - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.properties = properties - self.retry_settings = retry_settings - - -class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["PartialManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - properties: Optional["PartialBatchDeployment"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.properties = properties - self.sku = sku - self.tags = tags - - -class PartialBatchEndpoint(msrest.serialization.Model): - """Mutable Batch endpoint configuration. - - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - - _attribute_map = { - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - } - - def __init__( - self, - *, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(PartialBatchEndpoint, self).__init__(**kwargs) - self.defaults = defaults - - -class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchEndpoint - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["PartialManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - properties: Optional["PartialBatchEndpoint"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchEndpoint - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.properties = properties - self.sku = sku - self.tags = tags - - -class PartialBatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = None, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(PartialBatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class PartialCodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'min_length': 1}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - code_id: Optional[str] = None, - scoring_script: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(PartialCodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class PartialDataPathAssetReference(PartialAssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(PartialDataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class PartialIdAssetReference(PartialAssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(PartialIdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class PartialOnlineDeployment(msrest.serialization.Model): - """Mutable online deployment configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PartialKubernetesOnlineDeployment, PartialManagedOnlineDeployment. - - All required parameters must be populated in order to send to Azure. - - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'PartialKubernetesOnlineDeployment', 'Managed': 'PartialManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = None # type: Optional[str] - - -class PartialKubernetesOnlineDeployment(PartialOnlineDeployment): - """Properties specific to a KubernetesOnlineDeployment. - - All required parameters must be populated in order to send to Azure. - - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialKubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - - -class PartialManagedOnlineDeployment(PartialOnlineDeployment): - """Properties specific to a ManagedOnlineDeployment. - - All required parameters must be populated in order to send to Azure. - - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PartialManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineDeployment - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["PartialManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - properties: Optional["PartialOnlineDeployment"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineDeployment - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialOnlineDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.properties = properties - self.sku = sku - self.tags = tags - - -class PartialOnlineEndpoint(msrest.serialization.Model): - """Mutable online endpoint configuration. - - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _attribute_map = { - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(PartialOnlineEndpoint, self).__init__(**kwargs) - self.mirror_traffic = mirror_traffic - self.public_network_access = public_network_access - self.traffic = traffic - - -class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineEndpoint - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["PartialManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - properties: Optional["PartialOnlineEndpoint"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialOnlineEndpoint - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialOnlineEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.properties = properties - self.sku = sku - self.tags = tags - - -class PartialOutputPathAssetReference(PartialAssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(PartialOutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class PipelineJob(JobBaseDetails): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - schedule: Optional["ScheduleBase"] = None, - services: Optional[Dict[str, "JobService"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jobs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = inputs - self.jobs = jobs - self.outputs = outputs - self.settings = settings - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - failure_threshold: Optional[int] = 30, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = "PT10S", - success_threshold: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "PT2S", - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = failure_threshold - self.initial_delay = initial_delay - self.period = period - self.success_threshold = success_threshold - self.timeout = timeout - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = rule - self.seed = seed - - -class RecurrencePattern(msrest.serialization.Model): - """Recurrence schedule pattern definition. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for recurrence schedule pattern. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for recurrence schedule pattern. - :vartype minutes: list[int] - :ivar weekdays: List of weekdays for recurrence schedule pattern. - :vartype weekdays: list[str or ~azure.mgmt.machinelearningservices.models.Weekday] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'weekdays': {'key': 'weekdays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - weekdays: Optional[List[Union[str, "Weekday"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for recurrence schedule pattern. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for recurrence schedule pattern. - :paramtype minutes: list[int] - :keyword weekdays: List of weekdays for recurrence schedule pattern. - :paramtype weekdays: list[str or ~azure.mgmt.machinelearningservices.models.Weekday] - """ - super(RecurrencePattern, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.weekdays = weekdays - - -class RecurrenceSchedule(ScheduleBase): - """Recurrence schedule definition. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :vartype end_time: ~datetime.datetime - :ivar schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :vartype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar schedule_type: Required. [Required] Specifies the schedule type.Constant filled by - server. Possible values include: "Cron", "Recurrence". - :vartype schedule_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleType - :ivar start_time: Specifies start time of schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :vartype time_zone: str - :ivar frequency: Required. [Required] Specifies frequency with with which to trigger schedule. - Possible values include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar pattern: Specifies the recurrence schedule pattern. - :vartype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern - """ - - _validation = { - 'schedule_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'pattern': {'key': 'pattern', 'type': 'RecurrencePattern'}, - } - - def __init__( - self, - *, - frequency: Union[str, "RecurrenceFrequency"], - interval: int, - end_time: Optional[datetime.datetime] = None, - schedule_status: Optional[Union[str, "ScheduleStatus"]] = None, - start_time: Optional[datetime.datetime] = None, - time_zone: Optional[str] = "UTC", - pattern: Optional["RecurrencePattern"] = None, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601 format. - If not present, the schedule will run indefinitely. - :paramtype end_time: ~datetime.datetime - :keyword schedule_status: Specifies the schedule's status. Possible values include: "Enabled", - "Disabled". - :paramtype schedule_status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword start_time: Specifies start time of schedule in ISO 8601 format. - :paramtype start_time: ~datetime.datetime - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. - :paramtype time_zone: str - :keyword frequency: Required. [Required] Specifies frequency with with which to trigger - schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword pattern: Specifies the recurrence schedule pattern. - :paramtype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern - """ - super(RecurrenceSchedule, self).__init__(end_time=end_time, schedule_status=schedule_status, start_time=start_time, time_zone=time_zone, **kwargs) - self.schedule_type = 'Recurrence' # type: str - self.frequency = frequency - self.interval = interval - self.pattern = pattern - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - *, - key_type: Union[str, "KeyType"], - key_value: Optional[str] = None, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = key_type - self.key_value = key_value - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar allowed_models: Allowed models for regression task. - :vartype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_models: Blocked models for regression task. - :vartype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - training_settings: Optional["TrainingSettings"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - allowed_models: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_models: Optional[List[Union[str, "RegressionModels"]]] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword allowed_models: Allowed models for regression task. - :paramtype allowed_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_models: Blocked models for regression task. - :paramtype blocked_models: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - """ - super(Regression, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, training_settings=training_settings, **kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.training_settings = training_settings - self.task_type = 'Regression' # type: str - self.allowed_models = allowed_models - self.blocked_models = blocked_models - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'Regression' # type: str - self.allowed_models = allowed_models - self.blocked_models = blocked_models - self.primary_metric = primary_metric - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.properties = properties - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal", "KerberosKeytab", "KerberosPassword". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal", "KerberosPassword", "KerberosKeytab". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - *, - default: Optional[int] = 0, - maximum: Optional[int] = 0, - minimum: Optional[int] = 0, - scale_type: Optional[Union[str, "SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - self.minimum = minimum - self.scale_type = scale_type - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - *, - capacity: Optional["SkuCapacity"] = None, - sku: Optional["SkuSetting"] = None, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = capacity - self.resource_type = None - self.sku = sku - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["SkuResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage - self.stack_meta_learner_type = stack_meta_learner_type - - -class SweepJob(JobBaseDetails): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: "SamplingAlgorithm", - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - schedule: Optional["ScheduleBase"] = None, - services: Optional[Dict[str, "JobService"]] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = early_termination - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TableVerticalDataSettings(DataSettings): - """Class for data inputs. - - All required parameters must be populated in order to send to Azure. - - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.TableVerticalValidationDataSettings - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'TableVerticalValidationDataSettings'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - target_column_name: str, - training_data: "TrainingDataSettings", - test_data: Optional["TestDataSettings"] = None, - validation_data: Optional["TableVerticalValidationDataSettings"] = None, - weight_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: - ~azure.mgmt.machinelearningservices.models.TableVerticalValidationDataSettings - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVerticalDataSettings, self).__init__(target_column_name=target_column_name, test_data=test_data, training_data=training_data, **kwargs) - self.validation_data = validation_data - self.weight_column_name = weight_column_name - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar drop_columns: Columns to be dropped from data during featurization. - :vartype drop_columns: list[str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'drop_columns': {'key': 'dropColumns', 'type': '[str]'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[str]] = None, - column_name_and_types: Optional[Dict[str, str]] = None, - drop_columns: Optional[List[str]] = None, - enable_dnn_featurization: Optional[bool] = False, - mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword drop_columns: Columns to be dropped from data during featurization. - :paramtype drop_columns: list[str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - self.blocked_transformers = blocked_transformers - self.column_name_and_types = column_name_and_types - self.drop_columns = drop_columns - self.enable_dnn_featurization = enable_dnn_featurization - self.mode = mode - self.transformer_params = transformer_params - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - enable_early_termination: Optional[bool] = True, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = 1, - max_cores_per_trial: Optional[int] = -1, - max_trials: Optional[int] = 1000, - timeout: Optional[datetime.timedelta] = "PT6H", - trial_timeout: Optional[datetime.timedelta] = "PT30M", - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = enable_early_termination - self.exit_score = exit_score - self.max_concurrent_trials = max_concurrent_trials - self.max_cores_per_trial = max_cores_per_trial - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class TableVerticalValidationDataSettings(ValidationDataSettings): - """Validation settings for AutoML Table vertical tasks - Classification/Regression/Forecasting. - - :ivar data: Validation data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - } - - def __init__( - self, - *, - data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - cv_split_column_names: Optional[List[str]] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - **kwargs - ): - """ - :keyword data: Validation data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - """ - super(TableVerticalValidationDataSettings, self).__init__(data=data, validation_data_size=validation_data_size, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.n_cross_validations = n_cross_validations - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - max_instances: Optional[int] = 1, - min_instances: Optional[int] = 1, - polling_interval: Optional[datetime.timedelta] = "PT1S", - target_utilization_percentage: Optional[int] = 70, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = max_instances - self.min_instances = min_instances - self.polling_interval = polling_interval - self.target_utilization_percentage = target_utilization_percentage - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TestDataSettings(msrest.serialization.Model): - """Test data inputs. - - :ivar data: Test data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword data: Test data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - """ - super(TestDataSettings, self).__init__(**kwargs) - self.data = data - self.test_data_size = test_data_size - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, **kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, **kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - **kwargs - ): - """ - :keyword data_settings: Data inputs for AutoMLJob. - :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, **kwargs) - self.data_settings = data_settings - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.task_type = 'TextNER' # type: str - self.primary_metric = None - - -class TrainingDataSettings(msrest.serialization.Model): - """Training data input. - - All required parameters must be populated in order to send to Azure. - - :ivar data: Required. [Required] Training data MLTable. - :vartype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'data': {'required': True}, - } - - _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - data: "MLTableJobInput", - **kwargs - ): - """ - :keyword data: Required. [Required] Training data MLTable. - :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TrainingDataSettings, self).__init__(**kwargs) - self.data = data - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = False, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = enable_dnn_training - self.enable_model_explainability = enable_model_explainability - self.enable_onnx_compatible_models = enable_onnx_compatible_models - self.enable_stack_ensemble = enable_stack_ensemble - self.enable_vote_ensemble = enable_vote_ensemble - self.ensemble_model_download_timeout = ensemble_model_download_timeout - self.stack_ensemble_settings = stack_ensemble_settings - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["ResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'TritonModel' # type: str - self.description = description - self.job_input_type = 'TritonModel' # type: str - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'TritonModel' # type: str - self.description = description - self.job_output_type = 'TritonModel' # type: str - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UriFileDataVersion(DataVersionBaseDetails): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'UriFile' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'UriFile' # type: str - self.description = description - self.job_input_type = 'UriFile' # type: str - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'UriFile' # type: str - self.description = description - self.job_output_type = 'UriFile' # type: str - - -class UriFolderDataVersion(DataVersionBaseDetails): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "UriFile", "UriFolder", "MLTable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. - :paramtype data_uri: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'UriFolder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "Literal", "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'UriFolder' # type: str - self.description = description - self.job_input_type = 'UriFolder' # type: str - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "UriFile", "UriFolder", "MLTable", "CustomModel", - "MLFlowModel", "TritonModel". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'UriFolder' # type: str - self.description = description - self.job_output_type = 'UriFolder' # type: str - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py deleted file mode 100644 index a3a3e2ff32ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._jobs_operations import JobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations - -__all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 1bdd5852bc01..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,837 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class BatchDeploymentsOperations(object): - """BatchDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeploymentData" - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchDeploymentData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchDeploymentData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeploymentData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeploymentData"] - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeploymentData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeploymentData" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeploymentData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeploymentData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeploymentData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeploymentData"] - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeploymentData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index 8bf5580c7ca8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,889 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class BatchEndpointsOperations(object): - """BatchEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpointData" - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchEndpointData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpointData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialBatchEndpointPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchEndpointData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpointData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchEndpointPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialBatchEndpointPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpointData"] - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchEndpointPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpointData" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpointData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpointData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpointData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpointData"] - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpointData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index ad4463539388..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,481 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainerData" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CodeContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainerData" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index d909e2941c98..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,522 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class CodeVersionsOperations(object): - """CodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersionData" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.CodeVersionData" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersionData" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 1e9cbf7b959d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py +++ /dev/null @@ -1,489 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainerData" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ComponentContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainerData" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index e6a71b2bb151..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,530 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class ComponentVersionsOperations(object): - """ComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersionData" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ComponentVersionData" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersionData" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index f5719d84b86f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py +++ /dev/null @@ -1,489 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainerData" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DataContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainerData" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index d862606330f6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,542 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class DataVersionsOperations(object): - """DataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBaseData" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBaseData" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBaseData" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBaseData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 2e27c87ccd46..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,633 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', 30) # type: Optional[int] - is_default = kwargs.pop('is_default', None) # type: Optional[bool] - names = kwargs.pop('names', None) # type: Optional[List[str]] - search_text = kwargs.pop('search_text', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - order_by_asc = kwargs.pop('order_by_asc', False) # type: Optional[bool] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if is_default is not None: - query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') - if names is not None: - query_parameters['names'] = _SERIALIZER.query("names", names, '[str]', div=',') - if search_text is not None: - query_parameters['searchText'] = _SERIALIZER.query("search_text", search_text, 'str') - if order_by is not None: - query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if order_by_asc is not None: - query_parameters['orderByAsc'] = _SERIALIZER.query("order_by_asc", order_by_asc, 'bool') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - skip_validation = kwargs.pop('skip_validation', False) # type: Optional[bool] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip_validation is not None: - query_parameters['skipValidation'] = _SERIALIZER.query("skip_validation", skip_validation, 'bool') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class DatastoresOperations(object): - """DatastoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=30, # type: Optional[int] - is_default=None, # type: Optional[bool] - names=None, # type: Optional[List[str]] - search_text=None, # type: Optional[str] - order_by=None, # type: Optional[str] - order_by_asc=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DatastoreResourceArmPaginatedResult"] - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreData" - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DatastoreData" - skip_validation=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreData" - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DatastoreData - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DatastoreData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DatastoreData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DatastoreData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreSecrets" - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index accdfff6fdff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,489 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainerData" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.EnvironmentContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainerData" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index a530e2ee5fa3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,530 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentVersionsOperations(object): - """EnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersionData" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersionData" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersionData" - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py deleted file mode 100644 index e8197d202f3e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,674 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - job_type = kwargs.pop('job_type', None) # type: Optional[str] - tag = kwargs.pop('tag', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if job_type is not None: - query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') - if tag is not None: - query_parameters['tag'] = _SERIALIZER.query("tag", tag, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if scheduled is not None: - query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') - if schedule_id is not None: - query_parameters['scheduleId'] = _SERIALIZER.query("schedule_id", schedule_id, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "id": _SERIALIZER.url("id", id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_cancel_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - job_type=None, # type: Optional[str] - tag=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - scheduled=None, # type: Optional[bool] - schedule_id=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobBaseResourceArmPaginatedResult"] - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param scheduled: Indicator whether the job is scheduled job. - :type scheduled: bool - :param schedule_id: The scheduled id for listing the job triggered from. - :type schedule_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - scheduled=scheduled, - schedule_id=schedule_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBaseData" - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.JobBaseData" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBaseData" - """Creates and executes a Job. - - Creates and executes a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBaseData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBaseData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBaseData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBaseData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBaseData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - - - @distributed_trace - def cancel( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Cancels a Job. - - Cancels a Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_cancel_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - template_url=self.cancel.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index d136a15baca3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,497 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=None, # type: Optional[int] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainerData" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ModelContainerData" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainerData" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainerData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainerData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainerData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index 369cf06f7125..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,580 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - offset = kwargs.pop('offset', None) # type: Optional[int] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - feed = kwargs.pop('feed', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if offset is not None: - query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') - if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if feed is not None: - query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') - if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - offset=None, # type: Optional[int] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - feed=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersionData" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ModelVersionData" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersionData" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersionData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersionData') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersionData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 734da688e6c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1098 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_logs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class OnlineDeploymentsOperations(object): - """OnlineDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeploymentData" - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineDeploymentData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialOnlineDeploymentPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineDeploymentData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeploymentData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialOnlineDeploymentPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialOnlineDeploymentPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeploymentData"] - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialOnlineDeploymentPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeploymentData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeploymentData" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeploymentData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeploymentData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeploymentData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeploymentData"] - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeploymentData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - - @distributed_trace - def get_logs( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.DeploymentLogsRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeploymentLogs" - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeploymentLogs, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index c09668a6ad08..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1195 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - name = kwargs.pop('name', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - compute_type = kwargs.pop('compute_type', None) # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if name is not None: - query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if compute_type is not None: - query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-02-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class OnlineEndpointsOperations(object): - """OnlineEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name=None, # type: Optional[str] - count=None, # type: Optional[int] - compute_type=None, # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpointData" - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineEndpointData, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialOnlineEndpointPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineEndpointData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpointData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialOnlineEndpointPartialTrackedResource') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialOnlineEndpointPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpointData"] - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialOnlineEndpointPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpointData" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpointData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpointData') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpointData" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpointData"] - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpointData or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore - - - def _regenerate_keys_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - - @distributed_trace - def get_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthToken" - """Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthToken, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/online/online_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/online/online_deployment.py index 7f0760fecd00..fca174a62bb1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/online/online_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/online/online_deployment.py @@ -9,7 +9,7 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2022_02_01_preview.models import EndpointComputeType +from azure.ai.ml._restclient.arm_ml_service.models import EndpointComputeType from azure.ai.ml._schema._deployment.deployment import DeploymentSchema from azure.ai.ml._schema._utils.utils import exit_if_registry_assets from azure.ai.ml._schema.core.fields import ExperimentalField, NestedField, StringTransformedEnum, UnionField diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_endpoint/endpoint.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_endpoint/endpoint.py index 1ff43338bc74..5f8fdf5c600e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_endpoint/endpoint.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_endpoint/endpoint.py @@ -6,7 +6,7 @@ from marshmallow import fields, validate -from azure.ai.ml._restclient.v2022_02_01_preview.models import EndpointAuthMode +from azure.ai.ml._restclient.arm_ml_service.models import EndpointAuthMode from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum from azure.ai.ml._schema.core.schema import PathAwareSchema from azure.ai.ml._schema.identity import IdentitySchema diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_fields_provider.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_fields_provider.py index e96d4fa27a3c..71dc7ace54d2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_fields_provider.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_fields_provider.py @@ -4,7 +4,7 @@ from marshmallow import fields -from azure.ai.ml._restclient.v2022_02_01_preview.models import SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import SamplingAlgorithmType from azure.ai.ml._schema._sweep.search_space import ( ChoiceSchema, NormalSchema, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_termination.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_termination.py index 08fa9145bc5c..831520836d55 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_termination.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_termination.py @@ -8,7 +8,7 @@ from marshmallow import ValidationError, fields, post_load, pre_dump -from azure.ai.ml._restclient.v2022_02_01_preview.models import EarlyTerminationPolicyType +from azure.ai.ml._restclient.arm_ml_service.models import EarlyTerminationPolicyType from azure.ai.ml._schema.core.fields import StringTransformedEnum from azure.ai.ml._schema.core.schema import PatchedSchemaMeta from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py index 61e5abcbf845..ae1b487518be 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py @@ -39,7 +39,7 @@ WORKSPACE_MANAGED_DATASTORE, WORKSPACE_MANAGED_DATASTORE_WITH_SLASH, ) -from azure.ai.ml._restclient.v2022_02_01_preview.operations import ( +from azure.ai.ml._restclient.arm_ml_service.operations import ( ComponentContainersOperations, ComponentVersionsOperations, DataContainersOperations, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/import_node.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/import_node.py index 144753d5b249..0a4b27ea3e1f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/import_node.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/import_node.py @@ -8,8 +8,8 @@ from marshmallow import Schema -from azure.ai.ml._restclient.v2022_02_01_preview.models import CommandJob as RestCommandJob -from azure.ai.ml._restclient.v2022_02_01_preview.models import JobBaseData +from azure.ai.ml._restclient.arm_ml_service.models import CommandJob as RestCommandJob +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as JobBaseData from azure.ai.ml._schema.job.import_job import ImportJobSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY from azure.ai.ml.constants._component import ComponentSource, NodeType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment.py index 1f8c3e6c9016..b42d2f2eb3a3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment.py @@ -9,7 +9,7 @@ from os import PathLike from typing import IO, TYPE_CHECKING, Any, AnyStr, Dict, Optional, Union -from azure.ai.ml._restclient.v2022_02_01_preview.models import BatchDeploymentData +from azure.ai.ml._restclient.arm_ml_service.models import BatchDeployment as BatchDeploymentData from azure.ai.ml._restclient.arm_ml_service.models import OnlineDeployment as OnlineDeploymentData from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py index ae54d8c9237a..c51201d10232 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py @@ -9,11 +9,11 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, Optional, Union, cast -from azure.ai.ml._restclient.v2022_02_01_preview.models import EndpointAuthKeys as RestEndpointAuthKeys -from azure.ai.ml._restclient.v2022_02_01_preview.models import EndpointAuthMode -from azure.ai.ml._restclient.v2022_02_01_preview.models import EndpointAuthToken as RestEndpointAuthToken -from azure.ai.ml._restclient.v2022_02_01_preview.models import OnlineEndpointData -from azure.ai.ml._restclient.v2022_02_01_preview.models import OnlineEndpointDetails as RestOnlineEndpoint +from azure.ai.ml._restclient.arm_ml_service.models import EndpointAuthKeys as RestEndpointAuthKeys +from azure.ai.ml._restclient.arm_ml_service.models import EndpointAuthMode +from azure.ai.ml._restclient.arm_ml_service.models import EndpointAuthToken as RestEndpointAuthToken +from azure.ai.ml._restclient.arm_ml_service.models import OnlineEndpoint as OnlineEndpointData +from azure.ai.ml._restclient.arm_ml_service.models import OnlineEndpointProperties as RestOnlineEndpoint from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedServiceIdentity as RestManagedServiceIdentityConfiguration, ) @@ -182,10 +182,13 @@ def _to_rest_online_endpoint_traffic_update(self, location: str, no_validation: properties = RestOnlineEndpoint( description=self.description, auth_mode=OnlineEndpoint._yaml_auth_mode_to_rest_auth_mode(self.auth_mode), - endpoint=self.name, traffic=self.traffic, properties=self.properties, ) + # Preserve the 2022-02-01-preview wire field `endpoint` (not modeled in + # the latest TSP `OnlineEndpointProperties`). TSP hybrid models are + # mappings, so set the additional key directly on the dict surface. + properties["endpoint"] = self.name return OnlineEndpointData( location=location, properties=properties, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py index 24d4ec90724c..606f2408d496 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py @@ -7,8 +7,8 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, Optional -from azure.ai.ml._restclient.v2022_02_01_preview.models import CommandJob as RestCommandJob -from azure.ai.ml._restclient.v2022_02_01_preview.models import JobBaseData +from azure.ai.ml._restclient.arm_ml_service.models import CommandJob as RestCommandJob +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as JobBaseData from azure.ai.ml._schema.job.import_job import ImportJobSchema from azure.ai.ml._utils.utils import is_private_preview_enabled from azure.ai.ml.constants import JobType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py index 49b2c992d5d4..93d641aebda9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py @@ -6,7 +6,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2022_02_01_preview.models import JobBaseData +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as JobBaseData from azure.ai.ml._schema.job.parallel_job import ParallelJobSchema from azure.ai.ml._utils.utils import is_data_binding_expression from azure.ai.ml.constants import JobType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py index 96f6764a2718..91442dacee38 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py @@ -12,7 +12,6 @@ import msrest from marshmallow.exceptions import ValidationError -from .._restclient.v2022_02_01_preview.models import JobInputType as JobInputType02 from .._restclient.v2023_04_01_preview.models import JobInput as RestJobInput from .._restclient.v2023_04_01_preview.models import JobInputType as JobInputType10 from .._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput @@ -552,14 +551,17 @@ def normalize_job_input_output_type(input_output_value: Union[RestJobOutput, Res """ + # Keys are the camel-case string values used by the legacy v2022_02_01_preview + # REST payloads (e.g. "Literal", "UriFile"). They are hard-coded so this + # mapping does not depend on the v2022 generated enum class. FEB_JUN_JOB_INPUT_OUTPUT_TYPE_MAPPING = { - JobInputType02.CUSTOM_MODEL: JobInputType10.CUSTOM_MODEL, - JobInputType02.LITERAL: JobInputType10.LITERAL, - JobInputType02.ML_FLOW_MODEL: JobInputType10.MLFLOW_MODEL, - JobInputType02.ML_TABLE: JobInputType10.MLTABLE, - JobInputType02.TRITON_MODEL: JobInputType10.TRITON_MODEL, - JobInputType02.URI_FILE: JobInputType10.URI_FILE, - JobInputType02.URI_FOLDER: JobInputType10.URI_FOLDER, + "CustomModel": JobInputType10.CUSTOM_MODEL, + "Literal": JobInputType10.LITERAL, + "MlFlowModel": JobInputType10.MLFLOW_MODEL, + "MlTable": JobInputType10.MLTABLE, + "TritonModel": JobInputType10.TRITON_MODEL, + "UriFile": JobInputType10.URI_FILE, + "UriFolder": JobInputType10.URI_FOLDER, } if ( hasattr(input_output_value, "job_input_type") diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_ops_helper.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_ops_helper.py index d8d83bfe9b03..442c6297ca60 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_ops_helper.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_ops_helper.py @@ -15,9 +15,8 @@ from azure.ai.ml._artifacts._artifact_utilities import get_datastore_info, list_logs_in_datastore from azure.ai.ml._restclient.runhistory.models import Run, RunDetails, TypedAssetReference -from azure.ai.ml._restclient.v2022_02_01_preview.models import DataType -from azure.ai.ml._restclient.v2022_02_01_preview.models import JobType as RestJobType -from azure.ai.ml._restclient.v2022_02_01_preview.models import ModelType +from azure.ai.ml._restclient.arm_ml_service.models import DataType +from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType from azure.ai.ml._restclient.arm_ml_service.models import JobBase from azure.ai.ml._utils._http_utils import HttpPipeline from azure.ai.ml._utils.utils import create_requests_pipeline_with_retry, download_text_from_url @@ -503,7 +502,7 @@ def get_job_output_uris_from_dataplane( model_ids = [ run_outputs[output_name].asset_id for output_name in output_names - if run_outputs[output_name].type in [o.value for o in ModelType] + if run_outputs[output_name].type in ["CustomModel", "MLFlowModel", "TritonModel"] ] output_name_to_dataset_uri = {} diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_local_job_invoker.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_local_job_invoker.py index f901d2295817..d7c82a29c82b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_local_job_invoker.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_local_job_invoker.py @@ -18,7 +18,7 @@ from threading import Thread from typing import Any, Dict, Optional, Tuple -from azure.ai.ml._restclient.v2022_02_01_preview.models import JobBaseData +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as JobBaseData from azure.ai.ml._utils._http_utils import HttpPipeline from azure.ai.ml._utils.utils import DockerProxy from azure.ai.ml.constants._common import ( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py index bc8eb69ed017..034b9eea199c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py @@ -13,7 +13,7 @@ from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._local_endpoints import LocalEndpointMode -from azure.ai.ml._restclient.v2022_02_01_preview.models import DeploymentLogsRequest +from azure.ai.ml._restclient.arm_ml_service.models import DeploymentLogsRequest from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py index 37c098c0a0c6..ca5f7362b2dd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py @@ -11,8 +11,8 @@ from azure.ai.ml._azure_environments import _resource_to_scopes from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2022_02_01_preview import AzureMachineLearningWorkspaces as ServiceClient022022Preview -from azure.ai.ml._restclient.v2022_02_01_preview.models import KeyType, RegenerateEndpointKeysRequest +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient022022Preview +from azure.ai.ml._restclient.arm_ml_service.models import KeyType, RegenerateEndpointKeysRequest from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py index 94b3535a7f65..4e21b600ab3f 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_deployment_entity.py @@ -654,10 +654,11 @@ def test_from_rest_object(self) -> None: assert deployment.provisioning_state == deployment_rest.properties.provisioning_state def test_deployment_from_rest_object_for_batch_deployment(self) -> None: - from azure.ai.ml._restclient.v2022_02_01_preview.models import BatchDeploymentData as RestBatchDeploymentData + from azure.ai.ml._restclient.arm_ml_service.models import BatchDeployment as RestBatchDeploymentData + from azure.ai.ml._restclient.arm_ml_service._utils.model_base import _deserialize with open(TestBatchDeploymentSDK.DEPLOYMENT_REST, "r") as f: - deployment_rest = RestBatchDeploymentData.deserialize(json.load(f)) + deployment_rest = _deserialize(RestBatchDeploymentData, json.load(f)) deployment = Deployment._from_rest_object(deployment_rest) assert isinstance(deployment, BatchDeployment) assert deployment.name == deployment_rest.name diff --git a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_endpoint_entity.py b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_endpoint_entity.py index b1de2c69db4e..fede0ae90235 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_endpoint_entity.py +++ b/sdk/ml/azure-ai-ml/tests/batch_online_common/unittests/test_endpoint_entity.py @@ -7,9 +7,9 @@ from test_utilities.utils import verify_entity_load_and_dump from azure.ai.ml import load_batch_endpoint, load_online_endpoint -from azure.ai.ml._restclient.v2022_02_01_preview.models import EndpointAuthKeys as RestEndpointAuthKeys -from azure.ai.ml._restclient.v2022_02_01_preview.models import EndpointAuthToken as RestEndpointAuthToken -from azure.ai.ml._restclient.v2022_02_01_preview.models import OnlineEndpointData +from azure.ai.ml._restclient.arm_ml_service.models import EndpointAuthKeys as RestEndpointAuthKeys +from azure.ai.ml._restclient.arm_ml_service.models import EndpointAuthToken as RestEndpointAuthToken +from azure.ai.ml._restclient.arm_ml_service.models import OnlineEndpoint as OnlineEndpointData from azure.ai.ml._restclient.arm_ml_service.models import BatchEndpoint as BatchEndpointData from azure.ai.ml._restclient.arm_ml_service._utils.model_base import _deserialize from azure.ai.ml.entities import ( @@ -59,7 +59,7 @@ def test_online_endpoint_to_rest_object_with_no_issue(self) -> None: def test_from_rest_object_kubenetes(self) -> None: with open(TestOnlineEndpointYAML.ONLINE_ENDPOINT_REST, "r") as f: - online_deployment_rest = OnlineEndpointData.deserialize(json.load(f)) + online_deployment_rest = _deserialize(OnlineEndpointData, json.load(f)) online_endpoint = OnlineEndpoint._from_rest_object(online_deployment_rest) assert isinstance(online_endpoint, KubernetesOnlineEndpoint) assert online_endpoint.name == online_deployment_rest.name @@ -74,7 +74,7 @@ def test_from_rest_object_kubenetes(self) -> None: def test_from_rest_object_managed(self) -> None: with open(TestOnlineEndpointYAML.ONLINE_ENDPOINT_REST, "r") as f: - online_deployment_rest = OnlineEndpointData.deserialize(json.load(f)) + online_deployment_rest = _deserialize(OnlineEndpointData, json.load(f)) online_deployment_rest.properties.compute = None online_endpoint = OnlineEndpoint._from_rest_object(online_deployment_rest) assert isinstance(online_endpoint, ManagedOnlineEndpoint) diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 3e2480f67617..1ecb61ce1492 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -258,7 +258,7 @@ def mock_aml_services_workspace_dataplane(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2022_02_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2022_02_01_preview") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture diff --git a/sdk/ml/azure-ai-ml/tests/online_services/unittests/test_online_endpoints.py b/sdk/ml/azure-ai-ml/tests/online_services/unittests/test_online_endpoints.py index 80d3409321c1..0b111fd26f97 100644 --- a/sdk/ml/azure-ai-ml/tests/online_services/unittests/test_online_endpoints.py +++ b/sdk/ml/azure-ai-ml/tests/online_services/unittests/test_online_endpoints.py @@ -6,15 +6,15 @@ from azure.ai.ml import load_online_deployment, load_online_endpoint from azure.ai.ml._azure_environments import _resource_to_scopes -from azure.ai.ml._restclient.v2022_02_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( KubernetesOnlineDeployment as RestKubernetesOnlineDeployment, ) -from azure.ai.ml._restclient.v2022_02_01_preview.models import ( - OnlineDeploymentData, - OnlineDeploymentDetails, - OnlineEndpointData, +from azure.ai.ml._restclient.arm_ml_service.models import ( + OnlineDeployment as OnlineDeploymentData, + OnlineDeploymentProperties as OnlineDeploymentDetails, + OnlineEndpoint as OnlineEndpointData, ) -from azure.ai.ml._restclient.v2022_02_01_preview.models import OnlineEndpointDetails as RestOnlineEndpoint +from azure.ai.ml._restclient.arm_ml_service.models import OnlineEndpointProperties as RestOnlineEndpoint from azure.ai.ml._restclient.arm_ml_service.models import EndpointAuthKeys from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope from azure.ai.ml.constants._common import ( From 276b26a1d7c7f4b9a69c1350614f33a219565ccd Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 18 Jun 2026 16:15:46 +0530 Subject: [PATCH 2/6] Remove dead v2024_07_01_preview restclient (converged into 2024-10-01) The v2024_07_01_preview package had zero production consumers (datastore was consolidated onto 2024-10-01-preview earlier). The only remaining reference was an unused mock_aml_services_2024_07_01_preview conftest fixture; the equivalent mock_aml_services_2024_10_01_preview fixture already exists and points at the v2024_10_01_preview_tsp client. Delete the 76-file package and the stale fixture. --- .../v2024_07_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 317 - .../v2024_07_01_preview/_configuration.py | 76 - .../_restclient/v2024_07_01_preview/_patch.py | 31 - .../v2024_07_01_preview/_vendor.py | 27 - .../v2024_07_01_preview/_version.py | 9 - .../v2024_07_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 313 - .../v2024_07_01_preview/aio/_configuration.py | 72 - .../v2024_07_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 129 - .../_batch_deployments_operations.py | 642 - .../operations/_batch_endpoints_operations.py | 675 - .../operations/_code_containers_operations.py | 339 - .../operations/_code_versions_operations.py | 590 - .../_component_containers_operations.py | 344 - .../_component_versions_operations.py | 508 - .../aio/operations/_compute_operations.py | 1465 - .../aio/operations/_connection_operations.py | 630 - ...onnection_rai_blocklist_item_operations.py | 676 - ...nnection_rai_blocklist_items_operations.py | 141 - .../_connection_rai_blocklist_operations.py | 381 - .../_connection_rai_blocklists_operations.py | 136 - .../_connection_rai_policies_operations.py | 136 - .../_connection_rai_policy_operations.py | 381 - .../operations/_data_containers_operations.py | 344 - .../operations/_data_versions_operations.py | 517 - .../aio/operations/_datastores_operations.py | 448 - .../_endpoint_deployment_operations.py | 578 - .../aio/operations/_endpoint_operations.py | 587 - .../_environment_containers_operations.py | 344 - .../_environment_versions_operations.py | 508 - .../aio/operations/_features_operations.py | 247 - .../_featureset_containers_operations.py | 495 - .../_featureset_versions_operations.py | 672 - ...aturestore_entity_containers_operations.py | 495 - ...featurestore_entity_versions_operations.py | 526 - .../aio/operations/_jobs_operations.py | 540 - .../_managed_network_provisions_operations.py | 183 - ...anaged_network_settings_rule_operations.py | 458 - .../_marketplace_subscriptions_operations.py | 463 - .../_model_containers_operations.py | 349 - .../operations/_model_versions_operations.py | 540 - .../_online_deployments_operations.py | 823 - .../_online_endpoints_operations.py | 897 - .../aio/operations/_operations.py | 118 - ...private_endpoint_connections_operations.py | 332 - .../_private_link_resources_operations.py | 143 - .../aio/operations/_quotas_operations.py | 186 - .../operations/_rai_policies_operations.py | 136 - .../aio/operations/_rai_policy_operations.py | 381 - .../aio/operations/_registries_operations.py | 710 - .../_registry_code_containers_operations.py | 463 - .../_registry_code_versions_operations.py | 570 - ...egistry_component_containers_operations.py | 463 - ..._registry_component_versions_operations.py | 494 - .../_registry_data_containers_operations.py | 468 - .../_registry_data_references_operations.py | 120 - .../_registry_data_versions_operations.py | 584 - ...istry_environment_containers_operations.py | 468 - ...egistry_environment_versions_operations.py | 499 - .../_registry_model_containers_operations.py | 468 - .../_registry_model_versions_operations.py | 597 - .../aio/operations/_schedules_operations.py | 467 - .../_serverless_endpoints_operations.py | 810 - .../aio/operations/_usages_operations.py | 124 - .../_virtual_machine_sizes_operations.py | 99 - .../_workspace_connections_operations.py | 624 - .../_workspace_features_operations.py | 129 - .../aio/operations/_workspaces_operations.py | 1357 - .../v2024_07_01_preview/models/__init__.py | 2118 - ...azure_machine_learning_workspaces_enums.py | 2012 - .../v2024_07_01_preview/models/_models.py | 31310 -------------- .../v2024_07_01_preview/models/_models_py3.py | 33995 ---------------- .../operations/__init__.py | 129 - .../_batch_deployments_operations.py | 876 - .../operations/_batch_endpoints_operations.py | 934 - .../operations/_code_containers_operations.py | 511 - .../operations/_code_versions_operations.py | 873 - .../_component_containers_operations.py | 519 - .../_component_versions_operations.py | 743 - .../operations/_compute_operations.py | 2101 - .../operations/_connection_operations.py | 886 - ...onnection_rai_blocklist_item_operations.py | 914 - ...nnection_rai_blocklist_items_operations.py | 192 - .../_connection_rai_blocklist_operations.py | 521 - .../_connection_rai_blocklists_operations.py | 185 - .../_connection_rai_policies_operations.py | 185 - .../_connection_rai_policy_operations.py | 521 - .../operations/_data_containers_operations.py | 519 - .../operations/_data_versions_operations.py | 755 - .../operations/_datastores_operations.py | 684 - .../_endpoint_deployment_operations.py | 801 - .../operations/_endpoint_operations.py | 851 - .../_environment_containers_operations.py | 519 - .../_environment_versions_operations.py | 743 - .../operations/_features_operations.py | 359 - .../_featureset_containers_operations.py | 687 - .../_featureset_versions_operations.py | 924 - ...aturestore_entity_containers_operations.py | 687 - ...featurestore_entity_versions_operations.py | 732 - .../operations/_jobs_operations.py | 766 - .../_managed_network_provisions_operations.py | 234 - ...anaged_network_settings_rule_operations.py | 629 - .../_marketplace_subscriptions_operations.py | 637 - .../_model_containers_operations.py | 527 - .../operations/_model_versions_operations.py | 793 - .../_online_deployments_operations.py | 1150 - .../_online_endpoints_operations.py | 1257 - .../operations/_operations.py | 155 - ...private_endpoint_connections_operations.py | 501 - .../_private_link_resources_operations.py | 190 - .../operations/_quotas_operations.py | 269 - .../operations/_rai_policies_operations.py | 185 - .../operations/_rai_policy_operations.py | 521 - .../operations/_registries_operations.py | 988 - .../_registry_code_containers_operations.py | 636 - .../_registry_code_versions_operations.py | 802 - ...egistry_component_containers_operations.py | 637 - ..._registry_component_versions_operations.py | 682 - .../_registry_data_containers_operations.py | 644 - .../_registry_data_references_operations.py | 174 - .../_registry_data_versions_operations.py | 823 - ...istry_environment_containers_operations.py | 645 - ...egistry_environment_versions_operations.py | 690 - .../_registry_model_containers_operations.py | 645 - .../_registry_model_versions_operations.py | 844 - .../operations/_schedules_operations.py | 643 - .../_serverless_endpoints_operations.py | 1112 - .../operations/_usages_operations.py | 169 - .../_virtual_machine_sizes_operations.py | 144 - .../_workspace_connections_operations.py | 929 - .../_workspace_features_operations.py | 176 - .../operations/_workspaces_operations.py | 1923 - .../_restclient/v2024_07_01_preview/py.typed | 1 - sdk/ml/azure-ai-ml/tests/conftest.py | 5 - 136 files changed, 137818 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklists_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_item_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_items_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklists_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 83687c377b4b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.mgmt.core import ARMPipelineClient - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentVersionsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.operations.MarketplaceSubscriptionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.operations.JobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations - :ivar connection: ConnectionOperations operations - :vartype connection: azure.mgmt.machinelearningservices.operations.ConnectionOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.mgmt.machinelearningservices.operations.ConnectionRaiPoliciesOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.mgmt.machinelearningservices.operations.ConnectionRaiPolicyOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.operations.EndpointOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: azure.mgmt.machinelearningservices.operations.RaiPoliciesOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: azure.mgmt.machinelearningservices.operations.RaiPolicyOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2024-07-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policies = ConnectionRaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policy = ConnectionRaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_configuration.py deleted file mode 100644 index 982aa5d40da0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :keyword api_version: Api Version. The default value is "2024-07-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 3a141cdfdf63..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,313 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.aio.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.aio.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.aio.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentVersionsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.aio.operations.MarketplaceSubscriptionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.aio.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.aio.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.aio.operations.JobsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.aio.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.aio.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.aio.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.aio.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations - :ivar connection: ConnectionOperations operations - :vartype connection: azure.mgmt.machinelearningservices.aio.operations.ConnectionOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiPoliciesOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiPolicyOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.aio.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.aio.operations.EndpointOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: azure.mgmt.machinelearningservices.aio.operations.RaiPoliciesOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: azure.mgmt.machinelearningservices.aio.operations.RaiPolicyOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.aio.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2024-07-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policies = ConnectionRaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policy = ConnectionRaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_configuration.py deleted file mode 100644 index e929650335af..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :keyword api_version: Api Version. The default value is "2024-07-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/__init__.py deleted file mode 100644 index f76d571ef953..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._jobs_operations import JobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._connection_operations import ConnectionOperations -from ._connection_rai_blocklists_operations import ConnectionRaiBlocklistsOperations -from ._connection_rai_blocklist_operations import ConnectionRaiBlocklistOperations -from ._connection_rai_blocklist_item_operations import ConnectionRaiBlocklistItemOperations -from ._connection_rai_blocklist_items_operations import ConnectionRaiBlocklistItemsOperations -from ._connection_rai_policies_operations import ConnectionRaiPoliciesOperations -from ._connection_rai_policy_operations import ConnectionRaiPolicyOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._rai_policies_operations import RaiPoliciesOperations -from ._rai_policy_operations import RaiPolicyOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'MarketplaceSubscriptionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ConnectionOperations', - 'ConnectionRaiBlocklistsOperations', - 'ConnectionRaiBlocklistOperations', - 'ConnectionRaiBlocklistItemOperations', - 'ConnectionRaiBlocklistItemsOperations', - 'ConnectionRaiPoliciesOperations', - 'ConnectionRaiPolicyOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'RaiPoliciesOperations', - 'RaiPolicyOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 70afe55ae952..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,642 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchDeploymentsOperations: - """BatchDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.BatchDeployment": - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index 1b2e4fa02f19..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchEndpointsOperations: - """BatchEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.BatchEndpoint": - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index 05fb5a892cdc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index 758617ad1e2d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,590 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 7de26d970426..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 961f7cbe9ac7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,508 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index 3691676e7e7b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1465 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_allowed_resize_sizes_request, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_resize_request_initial, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_data_mounts_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComputeOperations: # pylint: disable=too-many-public-methods - """ComputeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PaginatedComputeResourcesList or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeResource": - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - @distributed_trace_async - async def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List["_models.CustomService"], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - - - @distributed_trace - def list_nodes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AmlComputeNodesInformation or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeSecrets": - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List["_models.ComputeInstanceDataMount"], - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - async def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace_async - async def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace_async - async def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - async def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace_async - async def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - @distributed_trace_async - async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.IdleShutdownSetting", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - - - @distributed_trace_async - async def get_allowed_resize_sizes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - async def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace_async - async def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_operations.py deleted file mode 100644 index ea14e6e7e101..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_operations.py +++ /dev/null @@ -1,630 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_operations import build_create_or_update_deployment_request_initial, build_delete_deployment_request_initial, build_get_deployment_request, build_get_models_request, build_list_deployments_request, build_list_models_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionOperations: - """ConnectionOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_deployments( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_deployments.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_deployments.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments"} # type: ignore - - async def _delete_deployment_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete_deployment( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_deployment_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get_deployment.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - async def _create_or_update_deployment_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointModels"]: - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models"} # type: ignore - - @distributed_trace_async - async def list_models( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.EndpointModels": - """Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointModels, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointModels - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointModels', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py deleted file mode 100644 index 6b13c244c4ff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py +++ /dev/null @@ -1,676 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_item_operations import build_add_bulk_request_initial, build_create_request_initial, build_delete_bulk_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistItemOperations: - """ConnectionRaiBlocklistItemOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _add_bulk_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List["_models.RaiBlocklistItemBulkRequest"], - **kwargs: Any - ) -> Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, '[RaiBlocklistItemBulkRequest]') - - request = build_add_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._add_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _add_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - - @distributed_trace_async - async def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List["_models.RaiBlocklistItemBulkRequest"], - **kwargs: Any - ) -> AsyncLROPoller[List["_models.RaiBlocklistItemPropertiesBasicResource"]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. - :type body: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemBulkRequest] - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either list of - RaiBlocklistItemPropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource]] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._add_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_add_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - async def _delete_bulk_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Any, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_delete_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._delete_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - - @distributed_trace_async - async def begin_delete_bulk( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Any, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. - :type body: any - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> "_models.RaiBlocklistItemPropertiesBasicResource": - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistItemPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: "_models.RaiBlocklistItemPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiBlocklistItemPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistItemPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: "_models.RaiBlocklistItemPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiBlocklistItemPropertiesBasicResource"]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - RaiBlocklistItemPropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py deleted file mode 100644 index 39949a32ffff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_items_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistItemsOperations: - """ConnectionRaiBlocklistItemsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"]: - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_operations.py deleted file mode 100644 index 54ecf567d397..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklist_operations.py +++ /dev/null @@ -1,381 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistOperations: - """ConnectionRaiBlocklistOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> "_models.RaiBlocklistPropertiesBasicResource": - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: "_models.RaiBlocklistPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiBlocklistPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: "_models.RaiBlocklistPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiBlocklistPropertiesBasicResource"]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiBlocklistPropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklists_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklists_operations.py deleted file mode 100644 index 66c9932ec662..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_blocklists_operations.py +++ /dev/null @@ -1,136 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklists_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistsOperations: - """ConnectionRaiBlocklistsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"]: - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policies_operations.py deleted file mode 100644 index b40980930cf8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policies_operations.py +++ /dev/null @@ -1,136 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_policies_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiPoliciesOperations: - """ConnectionRaiPoliciesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"]: - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policy_operations.py deleted file mode 100644 index 2e38e17b0e95..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_connection_rai_policy_operations.py +++ /dev/null @@ -1,381 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_policy_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiPolicyOperations: - """ConnectionRaiPolicyOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiPolicyPropertiesBasicResource"]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiPolicyPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index d0c8d7aabde6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index d2ebe75a169d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,517 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 3ae35d311a50..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,448 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DatastoresOperations: - """DatastoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.DatastoreResourceArmPaginatedResult"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Datastore": - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Datastore", - skip_validation: Optional[bool] = False, - **kwargs: Any - ) -> "_models.Datastore": - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional["_models.SecretExpiry"] = None, - **kwargs: Any - ) -> "_models.DatastoreSecrets": - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Secret expiry information. - :type body: ~azure.mgmt.machinelearningservices.models.SecretExpiry - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'SecretExpiry') - else: - _json = None - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_deployment_operations.py deleted file mode 100644 index 247ac3551577..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,578 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_deployment_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_in_workspace_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointDeploymentOperations: - """EndpointDeploymentOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_operations.py deleted file mode 100644 index 4c6a87093251..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_endpoint_operations.py +++ /dev/null @@ -1,587 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_operations import build_create_or_update_request_initial, build_get_models_request, build_get_request, build_list_keys_request, build_list_request, build_regenerate_keys_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointOperations: - """EndpointOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - include_inference_endpoints: Optional[bool] = False, - skip: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"]: - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param include_inference_endpoints: - :type include_inference_endpoints: bool - :param skip: Continuation token for pagination. - :type skip: str - :param expand: Whether the endpoint resource will be expand to include deployment information, - e.g. $expand=deployments. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointResourcePropertiesBasicResource": - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointResourcePropertiesBasicResource"]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointKeys": - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointModels"]: - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateServiceAccountKeyContent", - **kwargs: Any - ) -> "_models.AccountApiKeys": - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index ddb38c346623..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index 17c98f41c928..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,508 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_features_operations.py deleted file mode 100644 index e9e6bbbaf310..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_features_operations.py +++ /dev/null @@ -1,247 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesOperations: - """FeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 1000, - **kwargs: Any - ) -> AsyncIterable["_models.FeatureResourceArmPaginatedResult"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> "_models.Feature": - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index 203f4052a3d6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetContainersOperations: - """FeaturesetContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturesetContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index 7eb86dbe92f5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,672 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetVersionsOperations: - """FeaturesetVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturesetVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - async def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> Optional["_models.FeaturesetVersionBackfillResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace_async - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersionBackfillResponse"]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersionBackfillResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 1fe38bf5b042..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityContainersOperations: - """FeaturestoreEntityContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityContainer or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 2815df0569d7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,526 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityVersionsOperations: - """FeaturestoreEntityVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index beaff44ecd69..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,540 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - properties: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.JobBaseResourceArmPaginatedResult"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param properties: Comma-separated list of user property names (and optionally values). - Example: prop1,prop2=value2. - :type properties: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.JobBase": - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.JobBase", - **kwargs: Any - ) -> "_models.JobBase": - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - async def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - - - @distributed_trace_async - async def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index d4fd6423c134..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkProvisionsOperations: - """ManagedNetworkProvisionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace_async - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedNetworkProvisionStatus"]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 01a0417f8cd6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,458 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkSettingsRuleOperations: - """ManagedNetworkSettingsRuleOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.OutboundRuleListResult"]: - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> "_models.OutboundRuleBasicResource": - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OutboundRuleBasicResource"]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OutboundRuleBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index a60b397874bf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._marketplace_subscriptions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MarketplaceSubscriptionsOperations: - """MarketplaceSubscriptionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> AsyncLROPoller["_models.MarketplaceSubscription"]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either MarketplaceSubscription or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index 2c379a44323f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,349 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index ac7669e8ffa1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,540 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index d296a5681d7f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineDeploymentsOperations: - """OnlineDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.OnlineDeployment": - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.DeploymentLogsRequest", - **kwargs: Any - ) -> "_models.DeploymentLogs": - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeploymentLogs, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index f53fec9e07ba..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,897 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineEndpointsOperations: - """OnlineEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.OnlineEndpoint": - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - @distributed_trace_async - async def get_token( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthToken": - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthToken, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_operations.py deleted file mode 100644 index e4e8310a7636..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 2035b8d78ae3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,332 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> None: - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: "_models.PrivateEndpointConnection", - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 17db461c3c33..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,143 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index 99ab61c93674..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,186 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class QuotasOperations: - """QuotasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def update( - self, - location: str, - parameters: "_models.QuotaUpdateParameters", - **kwargs: Any - ) -> "_models.UpdateWorkspaceQuotasResult": - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateWorkspaceQuotasResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policies_operations.py deleted file mode 100644 index 44271a03b137..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policies_operations.py +++ /dev/null @@ -1,136 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._rai_policies_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RaiPoliciesOperations: - """RaiPoliciesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"]: - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policy_operations.py deleted file mode 100644 index 1438481d6556..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_rai_policy_operations.py +++ /dev/null @@ -1,381 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._rai_policy_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RaiPolicyOperations: - """RaiPolicyOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiPolicyPropertiesBasicResource"]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiPolicyPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 49edd9bca143..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,710 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistriesOperations: - """RegistriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.Registry": - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> "_models.Registry": - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - async def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace_async - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index c28fa686ccc5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeContainersOperations: - """RegistryCodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeContainer"]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index 5e48956f3e9f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeVersionsOperations: - """RegistryCodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 3b71111bbc58..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentContainersOperations: - """RegistryComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index c28b4a6df64c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,494 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentVersionsOperations: - """RegistryComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index 539ff5702e8c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataContainersOperations: - """RegistryDataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_references_operations.py deleted file mode 100644 index 9cf73b9b4852..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,120 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_references_operations import build_get_blob_reference_sas_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataReferencesOperations: - """RegistryDataReferencesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.GetBlobReferenceSASRequestDto", - **kwargs: Any - ) -> "_models.GetBlobReferenceSASResponseDto": - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index 9c3d6095e125..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,584 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataVersionsOperations: - """RegistryDataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataVersionBase"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 8ad6a11e78c0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentContainersOperations: - """RegistryEnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index ad5d46c77abb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentVersionsOperations: - """RegistryEnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index 6ba43ba48276..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelContainersOperations: - """RegistryModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelContainer"]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index f876212795a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,597 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelVersionsOperations: - """RegistryModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index 3a103c373fcf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_schedules_operations.py +++ /dev/null @@ -1,467 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SchedulesOperations: - """SchedulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Schedule": - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Schedule, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Schedule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> AsyncLROPoller["_models.Schedule"]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Schedule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 3b5decc4e7e6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,810 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._serverless_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ServerlessEndpointsOperations: - """ServerlessEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"]: - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.ServerlessEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> Optional["_models.EndpointAuthKeys"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointAuthKeys"]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 9a1112c3315f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListUsagesResult"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListUsagesResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index f4a3443f537c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualMachineSizesOperations: - """VirtualMachineSizesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - location: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index 66b0d50130c3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,624 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request, build_test_connection_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceConnectionsOperations: - """WorkspaceConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> None: - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionUpdateParameter"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - async def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace_async - async def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 3f61a7c50247..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspace_features_operations.py +++ /dev/null @@ -1,129 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceFeaturesOperations: - """WorkspaceFeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListAmlUserFeatureResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index f5ed07382952..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1357 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: - """WorkspacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.Workspace": - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.DiagnoseResponseResult"]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiagnoseResponseResult or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListWorkspaceKeysResult": - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListWorkspaceKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.NotebookAccessTokenResult": - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NotebookAccessTokenResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace_async - async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListNotebookKeysResult": - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListNotebookKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace_async - async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListStorageAccountKeysResult": - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListStorageAccountKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ExternalFQDNResponse": - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalFQDNResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace_async - async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace_async - async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/__init__.py deleted file mode 100644 index b60ce93270b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/__init__.py +++ /dev/null @@ -1,2118 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AADAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AKS - from ._models_py3 import AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountApiKeys - from ._models_py3 import AccountKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountKeyDatastoreCredentials - from ._models_py3 import AccountKeyDatastoreSecrets - from ._models_py3 import AcrDetails - from ._models_py3 import AksComputeSecrets - from ._models_py3 import AksComputeSecretsProperties - from ._models_py3 import AksNetworkingConfiguration - from ._models_py3 import AllFeatures - from ._models_py3 import AllNodes - from ._models_py3 import AmlCompute - from ._models_py3 import AmlComputeNodeInformation - from ._models_py3 import AmlComputeNodesInformation - from ._models_py3 import AmlComputeProperties - from ._models_py3 import AmlComputeSchema - from ._models_py3 import AmlToken - from ._models_py3 import AmlTokenComputeIdentity - from ._models_py3 import AmlUserFeature - from ._models_py3 import AnonymousAccessCredential - from ._models_py3 import ApiKeyAuthWorkspaceConnectionProperties - from ._models_py3 import ArmResourceId - from ._models_py3 import AssetBase - from ._models_py3 import AssetContainer - from ._models_py3 import AssetJobInput - from ._models_py3 import AssetJobOutput - from ._models_py3 import AssetReferenceBase - from ._models_py3 import AssignedUser - from ._models_py3 import AutoForecastHorizon - from ._models_py3 import AutoMLJob - from ._models_py3 import AutoMLVertical - from ._models_py3 import AutoNCrossValidations - from ._models_py3 import AutoPauseProperties - from ._models_py3 import AutoScaleProperties - from ._models_py3 import AutoSeasonality - from ._models_py3 import AutoTargetLags - from ._models_py3 import AutoTargetRollingWindowSize - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureDevOpsWebhook - from ._models_py3 import AzureFileDatastore - from ._models_py3 import BanditPolicy - from ._models_py3 import BatchDeployment - from ._models_py3 import BatchDeploymentConfiguration - from ._models_py3 import BatchDeploymentProperties - from ._models_py3 import BatchDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import BatchEndpoint - from ._models_py3 import BatchEndpointDefaults - from ._models_py3 import BatchEndpointProperties - from ._models_py3 import BatchEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import BatchPipelineComponentDeploymentConfiguration - from ._models_py3 import BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BlobReferenceForConsumptionDto - from ._models_py3 import BuildContext - from ._models_py3 import CapacityConfig - from ._models_py3 import CategoricalDataDriftMetricThreshold - from ._models_py3 import CategoricalDataQualityMetricThreshold - from ._models_py3 import CategoricalPredictionDriftMetricThreshold - from ._models_py3 import CertificateDatastoreCredentials - from ._models_py3 import CertificateDatastoreSecrets - from ._models_py3 import Classification - from ._models_py3 import ClassificationTrainingSettings - from ._models_py3 import ClusterUpdateParameters - from ._models_py3 import CodeConfiguration - from ._models_py3 import CodeContainer - from ._models_py3 import CodeContainerProperties - from ._models_py3 import CodeContainerResourceArmPaginatedResult - from ._models_py3 import CodeVersion - from ._models_py3 import CodeVersionProperties - from ._models_py3 import CodeVersionResourceArmPaginatedResult - from ._models_py3 import CognitiveServiceEndpointDeploymentResourceProperties - from ._models_py3 import CognitiveServicesSku - from ._models_py3 import Collection - from ._models_py3 import ColumnTransformer - from ._models_py3 import CommandJob - from ._models_py3 import CommandJobLimits - from ._models_py3 import ComponentContainer - from ._models_py3 import ComponentContainerProperties - from ._models_py3 import ComponentContainerResourceArmPaginatedResult - from ._models_py3 import ComponentVersion - from ._models_py3 import ComponentVersionProperties - from ._models_py3 import ComponentVersionResourceArmPaginatedResult - from ._models_py3 import Compute - from ._models_py3 import ComputeInstance - from ._models_py3 import ComputeInstanceApplication - from ._models_py3 import ComputeInstanceAutologgerSettings - from ._models_py3 import ComputeInstanceConnectivityEndpoints - from ._models_py3 import ComputeInstanceContainer - from ._models_py3 import ComputeInstanceCreatedBy - from ._models_py3 import ComputeInstanceDataDisk - from ._models_py3 import ComputeInstanceDataMount - from ._models_py3 import ComputeInstanceEnvironmentInfo - from ._models_py3 import ComputeInstanceLastOperation - from ._models_py3 import ComputeInstanceProperties - from ._models_py3 import ComputeInstanceSchema - from ._models_py3 import ComputeInstanceSshSettings - from ._models_py3 import ComputeInstanceVersion - from ._models_py3 import ComputeRecurrenceSchedule - from ._models_py3 import ComputeResource - from ._models_py3 import ComputeResourceSchema - from ._models_py3 import ComputeRuntimeDto - from ._models_py3 import ComputeSchedules - from ._models_py3 import ComputeSecrets - from ._models_py3 import ComputeStartStopSchedule - from ._models_py3 import ContainerResourceRequirements - from ._models_py3 import ContainerResourceSettings - from ._models_py3 import ContentSafety - from ._models_py3 import ContentSafetyEndpointDeploymentResourceProperties - from ._models_py3 import ContentSafetyEndpointResourceProperties - from ._models_py3 import CosmosDbSettings - from ._models_py3 import CreateMonitorAction - from ._models_py3 import Cron - from ._models_py3 import CronTrigger - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomKeys - from ._models_py3 import CustomKeysWorkspaceConnectionProperties - from ._models_py3 import CustomMetricThreshold - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - from ._models_py3 import CustomMonitoringSignal - from ._models_py3 import CustomNCrossValidations - from ._models_py3 import CustomSeasonality - from ._models_py3 import CustomService - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataCollector - from ._models_py3 import DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - from ._models_py3 import DataDriftMetricThresholdBase - from ._models_py3 import DataDriftMonitoringSignal - from ._models_py3 import DataFactory - from ._models_py3 import DataLakeAnalytics - from ._models_py3 import DataLakeAnalyticsSchema - from ._models_py3 import DataLakeAnalyticsSchemaProperties - from ._models_py3 import DataPathAssetReference - from ._models_py3 import DataQualityMetricThresholdBase - from ._models_py3 import DataQualityMonitoringSignal - from ._models_py3 import DataReferenceCredential - from ._models_py3 import DataVersionBase - from ._models_py3 import DataVersionBaseProperties - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import Databricks - from ._models_py3 import DatabricksComputeSecrets - from ._models_py3 import DatabricksComputeSecretsProperties - from ._models_py3 import DatabricksProperties - from ._models_py3 import DatabricksSchema - from ._models_py3 import Datastore - from ._models_py3 import DatastoreCredentials - from ._models_py3 import DatastoreProperties - from ._models_py3 import DatastoreResourceArmPaginatedResult - from ._models_py3 import DatastoreSecrets - from ._models_py3 import DefaultScaleSettings - from ._models_py3 import DeploymentLogs - from ._models_py3 import DeploymentLogsRequest - from ._models_py3 import DeploymentResourceConfiguration - from ._models_py3 import DestinationAsset - from ._models_py3 import DiagnoseRequestProperties - from ._models_py3 import DiagnoseResponseResult - from ._models_py3 import DiagnoseResponseResultValue - from ._models_py3 import DiagnoseResult - from ._models_py3 import DiagnoseWorkspaceParameters - from ._models_py3 import DistributionConfiguration - from ._models_py3 import Docker - from ._models_py3 import DockerCredential - from ._models_py3 import EarlyTerminationPolicy - from ._models_py3 import EncryptionKeyVaultUpdateProperties - from ._models_py3 import EncryptionProperty - from ._models_py3 import EncryptionUpdateProperties - from ._models_py3 import Endpoint - from ._models_py3 import EndpointAuthKeys - from ._models_py3 import EndpointAuthToken - from ._models_py3 import EndpointDeploymentModel - from ._models_py3 import EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointDeploymentResourceProperties - from ._models_py3 import EndpointDeploymentResourcePropertiesBasicResource - from ._models_py3 import EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult - from ._models_py3 import EndpointKeys - from ._models_py3 import EndpointModelDeprecationProperties - from ._models_py3 import EndpointModelProperties - from ._models_py3 import EndpointModelSkuCapacityProperties - from ._models_py3 import EndpointModelSkuProperties - from ._models_py3 import EndpointModelSkuRateLimitProperties - from ._models_py3 import EndpointModelSkuRateLimitRulePatternProperties - from ._models_py3 import EndpointModelSkuRateLimitRuleProperties - from ._models_py3 import EndpointModels - from ._models_py3 import EndpointPropertiesBase - from ._models_py3 import EndpointResourceProperties - from ._models_py3 import EndpointResourcePropertiesBasicResource - from ._models_py3 import EndpointResourcePropertiesBasicResourceArmPaginatedResult - from ._models_py3 import EndpointScheduleAction - from ._models_py3 import EnvironmentContainer - from ._models_py3 import EnvironmentContainerProperties - from ._models_py3 import EnvironmentContainerResourceArmPaginatedResult - from ._models_py3 import EnvironmentVariable - from ._models_py3 import EnvironmentVersion - from ._models_py3 import EnvironmentVersionProperties - from ._models_py3 import EnvironmentVersionResourceArmPaginatedResult - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import EstimatedVMPrice - from ._models_py3 import EstimatedVMPrices - from ._models_py3 import ExternalFQDNResponse - from ._models_py3 import FQDNEndpoint - from ._models_py3 import FQDNEndpointDetail - from ._models_py3 import FQDNEndpoints - from ._models_py3 import FQDNEndpointsPropertyBag - from ._models_py3 import Feature - from ._models_py3 import FeatureAttributionDriftMonitoringSignal - from ._models_py3 import FeatureAttributionMetricThreshold - from ._models_py3 import FeatureImportanceSettings - from ._models_py3 import FeatureProperties - from ._models_py3 import FeatureResourceArmPaginatedResult - from ._models_py3 import FeatureStoreSettings - from ._models_py3 import FeatureSubset - from ._models_py3 import FeatureWindow - from ._models_py3 import FeaturesetContainer - from ._models_py3 import FeaturesetContainerProperties - from ._models_py3 import FeaturesetContainerResourceArmPaginatedResult - from ._models_py3 import FeaturesetSpecification - from ._models_py3 import FeaturesetVersion - from ._models_py3 import FeaturesetVersionBackfillRequest - from ._models_py3 import FeaturesetVersionBackfillResponse - from ._models_py3 import FeaturesetVersionProperties - from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityContainer - from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityVersion - from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult - from ._models_py3 import FeaturizationSettings - from ._models_py3 import FixedInputData - from ._models_py3 import FlavorData - from ._models_py3 import ForecastHorizon - from ._models_py3 import Forecasting - from ._models_py3 import ForecastingSettings - from ._models_py3 import ForecastingTrainingSettings - from ._models_py3 import FqdnOutboundRule - from ._models_py3 import GetBlobReferenceForConsumptionDto - from ._models_py3 import GetBlobReferenceSASRequestDto - from ._models_py3 import GetBlobReferenceSASResponseDto - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import IdAssetReference - from ._models_py3 import IdentityConfiguration - from ._models_py3 import IdentityForCmk - from ._models_py3 import IdleShutdownSetting - from ._models_py3 import Image - from ._models_py3 import ImageClassification - from ._models_py3 import ImageClassificationBase - from ._models_py3 import ImageClassificationMultilabel - from ._models_py3 import ImageInstanceSegmentation - from ._models_py3 import ImageLimitSettings - from ._models_py3 import ImageMetadata - from ._models_py3 import ImageModelDistributionSettings - from ._models_py3 import ImageModelDistributionSettingsClassification - from ._models_py3 import ImageModelDistributionSettingsObjectDetection - from ._models_py3 import ImageModelSettings - from ._models_py3 import ImageModelSettingsClassification - from ._models_py3 import ImageModelSettingsObjectDetection - from ._models_py3 import ImageObjectDetection - from ._models_py3 import ImageObjectDetectionBase - from ._models_py3 import ImageSweepSettings - from ._models_py3 import ImageVertical - from ._models_py3 import IndexColumn - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import InstanceTypeSchema - from ._models_py3 import InstanceTypeSchemaResources - from ._models_py3 import JobBase - from ._models_py3 import JobBaseProperties - from ._models_py3 import JobBaseResourceArmPaginatedResult - from ._models_py3 import JobInput - from ._models_py3 import JobLimits - from ._models_py3 import JobOutput - from ._models_py3 import JobResourceConfiguration - from ._models_py3 import JobScheduleAction - from ._models_py3 import JobService - from ._models_py3 import JupyterKernelConfig - from ._models_py3 import KeyVaultProperties - from ._models_py3 import Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LakeHouseArtifact - from ._models_py3 import ListAmlUserFeatureResult - from ._models_py3 import ListNotebookKeysResult - from ._models_py3 import ListStorageAccountKeysResult - from ._models_py3 import ListUsagesResult - from ._models_py3 import ListWorkspaceKeysResult - from ._models_py3 import ListWorkspaceQuotas - from ._models_py3 import LiteralJobInput - from ._models_py3 import MLFlowModelJobInput - from ._models_py3 import MLFlowModelJobOutput - from ._models_py3 import MLTableData - from ._models_py3 import MLTableJobInput - from ._models_py3 import MLTableJobOutput - from ._models_py3 import ManagedComputeIdentity - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedIdentityCredential - from ._models_py3 import ManagedNetworkProvisionOptions - from ._models_py3 import ManagedNetworkProvisionStatus - from ._models_py3 import ManagedNetworkSettings - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedOnlineEndpointDeploymentResourceProperties - from ._models_py3 import ManagedOnlineEndpointResourceProperties - from ._models_py3 import ManagedResourceGroupAssignedIdentities - from ._models_py3 import ManagedResourceGroupSettings - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MarketplacePlan - from ._models_py3 import MarketplaceSubscription - from ._models_py3 import MarketplaceSubscriptionProperties - from ._models_py3 import MarketplaceSubscriptionResourceArmPaginatedResult - from ._models_py3 import MaterializationComputeResource - from ._models_py3 import MaterializationSettings - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelSettings - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import MonitorComputeConfigurationBase - from ._models_py3 import MonitorComputeIdentityBase - from ._models_py3 import MonitorDefinition - from ._models_py3 import MonitorEmailNotificationSettings - from ._models_py3 import MonitorNotificationSettings - from ._models_py3 import MonitorServerlessSparkCompute - from ._models_py3 import MonitoringFeatureFilterBase - from ._models_py3 import MonitoringInputDataBase - from ._models_py3 import MonitoringSignalBase - from ._models_py3 import MonitoringTarget - from ._models_py3 import MonitoringThreshold - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpVertical - from ._models_py3 import NlpVerticalFeaturizationSettings - from ._models_py3 import NlpVerticalLimitSettings - from ._models_py3 import NodeStateCounts - from ._models_py3 import Nodes - from ._models_py3 import NoneAuthTypeWorkspaceConnectionProperties - from ._models_py3 import NoneDatastoreCredentials - from ._models_py3 import NotebookAccessTokenResult - from ._models_py3 import NotebookPreparationError - from ._models_py3 import NotebookResourceInfo - from ._models_py3 import NotificationSetting - from ._models_py3 import NumericalDataDriftMetricThreshold - from ._models_py3 import NumericalDataQualityMetricThreshold - from ._models_py3 import NumericalPredictionDriftMetricThreshold - from ._models_py3 import OAuth2AuthTypeWorkspaceConnectionProperties - from ._models_py3 import Objective - from ._models_py3 import OneLakeArtifact - from ._models_py3 import OneLakeDatastore - from ._models_py3 import OnlineDeployment - from ._models_py3 import OnlineDeploymentProperties - from ._models_py3 import OnlineDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineEndpoint - from ._models_py3 import OnlineEndpointProperties - from ._models_py3 import OnlineEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import OpenAIEndpointDeploymentResourceProperties - from ._models_py3 import OpenAIEndpointResourceProperties - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import OsPatchingStatus - from ._models_py3 import OutboundRule - from ._models_py3 import OutboundRuleBasicResource - from ._models_py3 import OutboundRuleListResult - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties - from ._models_py3 import PaginatedComputeResourcesList - from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - from ._models_py3 import PartialManagedServiceIdentity - from ._models_py3 import PartialMinimalTrackedResource - from ._models_py3 import PartialMinimalTrackedResourceWithIdentity - from ._models_py3 import PartialMinimalTrackedResourceWithSku - from ._models_py3 import PartialMinimalTrackedResourceWithSkuAndIdentity - from ._models_py3 import PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PendingUploadCredentialDto - from ._models_py3 import PendingUploadRequestDto - from ._models_py3 import PendingUploadResponseDto - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - from ._models_py3 import PredictionDriftMetricThresholdBase - from ._models_py3 import PredictionDriftMonitoringSignal - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateEndpointDestination - from ._models_py3 import PrivateEndpointOutboundRule - from ._models_py3 import PrivateEndpointResource - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import ProbeSettings - from ._models_py3 import ProxyResource - from ._models_py3 import PyTorch - from ._models_py3 import QueueSettings - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RaiBlocklistConfig - from ._models_py3 import RaiBlocklistItemBulkRequest - from ._models_py3 import RaiBlocklistItemProperties - from ._models_py3 import RaiBlocklistItemPropertiesBasicResource - from ._models_py3 import RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RaiBlocklistProperties - from ._models_py3 import RaiBlocklistPropertiesBasicResource - from ._models_py3 import RaiBlocklistPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RaiPolicyContentFilter - from ._models_py3 import RaiPolicyProperties - from ._models_py3 import RaiPolicyPropertiesBasicResource - from ._models_py3 import RaiPolicyPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import Recurrence - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import RegenerateServiceAccountKeyContent - from ._models_py3 import Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryPartialManagedServiceIdentity - from ._models_py3 import RegistryPrivateEndpointConnection - from ._models_py3 import RegistryPrivateLinkServiceConnectionState - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionTrainingSettings - from ._models_py3 import RequestLogging - from ._models_py3 import ResizeSchema - from ._models_py3 import Resource - from ._models_py3 import ResourceBase - from ._models_py3 import ResourceConfiguration - from ._models_py3 import ResourceId - from ._models_py3 import ResourceName - from ._models_py3 import ResourceQuota - from ._models_py3 import RollingInputData - from ._models_py3 import Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - from ._models_py3 import SASCredential - from ._models_py3 import SASCredentialDto - from ._models_py3 import SamplingAlgorithm - from ._models_py3 import SasDatastoreCredentials - from ._models_py3 import SasDatastoreSecrets - from ._models_py3 import ScaleSettings - from ._models_py3 import ScaleSettingsInformation - from ._models_py3 import Schedule - from ._models_py3 import ScheduleActionBase - from ._models_py3 import ScheduleBase - from ._models_py3 import ScheduleProperties - from ._models_py3 import ScheduleResourceArmPaginatedResult - from ._models_py3 import ScriptReference - from ._models_py3 import ScriptsToExecute - from ._models_py3 import Seasonality - from ._models_py3 import SecretExpiry - from ._models_py3 import ServerlessComputeSettings - from ._models_py3 import ServerlessEndpoint - from ._models_py3 import ServerlessEndpointCapacityReservation - from ._models_py3 import ServerlessEndpointContentSafety - from ._models_py3 import ServerlessEndpointInferenceEndpoint - from ._models_py3 import ServerlessEndpointModelSettings - from ._models_py3 import ServerlessEndpointProperties - from ._models_py3 import ServerlessEndpointResourceProperties - from ._models_py3 import ServerlessEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import ServerlessInferenceEndpoint - from ._models_py3 import ServerlessOffer - from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - from ._models_py3 import ServiceTagDestination - from ._models_py3 import ServiceTagOutboundRule - from ._models_py3 import SetupScripts - from ._models_py3 import SharedPrivateLinkResource - from ._models_py3 import Sku - from ._models_py3 import SkuCapacity - from ._models_py3 import SkuResource - from ._models_py3 import SkuResourceArmPaginatedResult - from ._models_py3 import SkuSetting - from ._models_py3 import SparkJob - from ._models_py3 import SparkJobEntry - from ._models_py3 import SparkJobPythonEntry - from ._models_py3 import SparkJobScalaEntry - from ._models_py3 import SparkResourceConfiguration - from ._models_py3 import SpeechEndpointDeploymentResourceProperties - from ._models_py3 import SpeechEndpointResourceProperties - from ._models_py3 import SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StaticInputData - from ._models_py3 import StorageAccountDetails - from ._models_py3 import SweepJob - from ._models_py3 import SweepJobLimits - from ._models_py3 import SynapseSpark - from ._models_py3 import SynapseSparkProperties - from ._models_py3 import SystemCreatedAcrAccount - from ._models_py3 import SystemCreatedStorageAccount - from ._models_py3 import SystemData - from ._models_py3 import SystemService - from ._models_py3 import TableVertical - from ._models_py3 import TableVerticalFeaturizationSettings - from ._models_py3 import TableVerticalLimitSettings - from ._models_py3 import TargetLags - from ._models_py3 import TargetRollingWindowSize - from ._models_py3 import TargetUtilizationScaleSettings - from ._models_py3 import TensorFlow - from ._models_py3 import TextClassification - from ._models_py3 import TextClassificationMultilabel - from ._models_py3 import TextNer - from ._models_py3 import TmpfsOptions - from ._models_py3 import TopNFeaturesByAttribution - from ._models_py3 import TrackedResource - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TriggerBase - from ._models_py3 import TritonModelJobInput - from ._models_py3 import TritonModelJobOutput - from ._models_py3 import TruncationSelectionPolicy - from ._models_py3 import UpdateWorkspaceQuotas - from ._models_py3 import UpdateWorkspaceQuotasResult - from ._models_py3 import UriFileDataVersion - from ._models_py3 import UriFileJobInput - from ._models_py3 import UriFileJobOutput - from ._models_py3 import UriFolderDataVersion - from ._models_py3 import UriFolderJobInput - from ._models_py3 import UriFolderJobOutput - from ._models_py3 import Usage - from ._models_py3 import UsageName - from ._models_py3 import UserAccountCredentials - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import UserCreatedAcrAccount - from ._models_py3 import UserCreatedStorageAccount - from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties - from ._models_py3 import VirtualMachine - from ._models_py3 import VirtualMachineImage - from ._models_py3 import VirtualMachineSchema - from ._models_py3 import VirtualMachineSchemaProperties - from ._models_py3 import VirtualMachineSecrets - from ._models_py3 import VirtualMachineSecretsSchema - from ._models_py3 import VirtualMachineSize - from ._models_py3 import VirtualMachineSizeListResult - from ._models_py3 import VirtualMachineSshCredentials - from ._models_py3 import VolumeDefinition - from ._models_py3 import VolumeOptions - from ._models_py3 import Webhook - from ._models_py3 import Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionAccountKey - from ._models_py3 import WorkspaceConnectionApiKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - from ._models_py3 import WorkspaceConnectionOAuth2 - from ._models_py3 import WorkspaceConnectionPersonalAccessToken - from ._models_py3 import WorkspaceConnectionPropertiesV2 - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult - from ._models_py3 import WorkspaceConnectionServicePrincipal - from ._models_py3 import WorkspaceConnectionSharedAccessSignature - from ._models_py3 import WorkspaceConnectionUpdateParameter - from ._models_py3 import WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceHubConfig - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspacePrivateEndpointResource - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - from ._models import AADAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AKS # type: ignore - from ._models import AKSSchema # type: ignore - from ._models import AKSSchemaProperties # type: ignore - from ._models import AccessKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountApiKeys # type: ignore - from ._models import AccountKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AcrDetails # type: ignore - from ._models import AksComputeSecrets # type: ignore - from ._models import AksComputeSecretsProperties # type: ignore - from ._models import AksNetworkingConfiguration # type: ignore - from ._models import AllFeatures # type: ignore - from ._models import AllNodes # type: ignore - from ._models import AmlCompute # type: ignore - from ._models import AmlComputeNodeInformation # type: ignore - from ._models import AmlComputeNodesInformation # type: ignore - from ._models import AmlComputeProperties # type: ignore - from ._models import AmlComputeSchema # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlTokenComputeIdentity # type: ignore - from ._models import AmlUserFeature # type: ignore - from ._models import AnonymousAccessCredential # type: ignore - from ._models import ApiKeyAuthWorkspaceConnectionProperties # type: ignore - from ._models import ArmResourceId # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AssignedUser # type: ignore - from ._models import AutoForecastHorizon # type: ignore - from ._models import AutoMLJob # type: ignore - from ._models import AutoMLVertical # type: ignore - from ._models import AutoNCrossValidations # type: ignore - from ._models import AutoPauseProperties # type: ignore - from ._models import AutoScaleProperties # type: ignore - from ._models import AutoSeasonality # type: ignore - from ._models import AutoTargetLags # type: ignore - from ._models import AutoTargetRollingWindowSize # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureDatastore # type: ignore - from ._models import AzureDevOpsWebhook # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BatchDeployment # type: ignore - from ._models import BatchDeploymentConfiguration # type: ignore - from ._models import BatchDeploymentProperties # type: ignore - from ._models import BatchDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchEndpoint # type: ignore - from ._models import BatchEndpointDefaults # type: ignore - from ._models import BatchEndpointProperties # type: ignore - from ._models import BatchEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchPipelineComponentDeploymentConfiguration # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # type: ignore - from ._models import BlobReferenceForConsumptionDto # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CapacityConfig # type: ignore - from ._models import CategoricalDataDriftMetricThreshold # type: ignore - from ._models import CategoricalDataQualityMetricThreshold # type: ignore - from ._models import CategoricalPredictionDriftMetricThreshold # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import Classification # type: ignore - from ._models import ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainer # type: ignore - from ._models import CodeContainerProperties # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersion # type: ignore - from ._models import CodeVersionProperties # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import CognitiveServiceEndpointDeploymentResourceProperties # type: ignore - from ._models import CognitiveServicesSku # type: ignore - from ._models import Collection # type: ignore - from ._models import ColumnTransformer # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentContainer # type: ignore - from ._models import ComponentContainerProperties # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentVersion # type: ignore - from ._models import ComponentVersionProperties # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import Compute # type: ignore - from ._models import ComputeInstance # type: ignore - from ._models import ComputeInstanceApplication # type: ignore - from ._models import ComputeInstanceAutologgerSettings # type: ignore - from ._models import ComputeInstanceConnectivityEndpoints # type: ignore - from ._models import ComputeInstanceContainer # type: ignore - from ._models import ComputeInstanceCreatedBy # type: ignore - from ._models import ComputeInstanceDataDisk # type: ignore - from ._models import ComputeInstanceDataMount # type: ignore - from ._models import ComputeInstanceEnvironmentInfo # type: ignore - from ._models import ComputeInstanceLastOperation # type: ignore - from ._models import ComputeInstanceProperties # type: ignore - from ._models import ComputeInstanceSchema # type: ignore - from ._models import ComputeInstanceSshSettings # type: ignore - from ._models import ComputeInstanceVersion # type: ignore - from ._models import ComputeRecurrenceSchedule # type: ignore - from ._models import ComputeResource # type: ignore - from ._models import ComputeResourceSchema # type: ignore - from ._models import ComputeRuntimeDto # type: ignore - from ._models import ComputeSchedules # type: ignore - from ._models import ComputeSecrets # type: ignore - from ._models import ComputeStartStopSchedule # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import ContainerResourceSettings # type: ignore - from ._models import ContentSafety # type: ignore - from ._models import ContentSafetyEndpointDeploymentResourceProperties # type: ignore - from ._models import ContentSafetyEndpointResourceProperties # type: ignore - from ._models import CosmosDbSettings # type: ignore - from ._models import CreateMonitorAction # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomKeys # type: ignore - from ._models import CustomKeysWorkspaceConnectionProperties # type: ignore - from ._models import CustomMetricThreshold # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import CustomMonitoringSignal # type: ignore - from ._models import CustomNCrossValidations # type: ignore - from ._models import CustomSeasonality # type: ignore - from ._models import CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataCollector # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataDriftMetricThresholdBase # type: ignore - from ._models import DataDriftMonitoringSignal # type: ignore - from ._models import DataFactory # type: ignore - from ._models import DataLakeAnalytics # type: ignore - from ._models import DataLakeAnalyticsSchema # type: ignore - from ._models import DataLakeAnalyticsSchemaProperties # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataQualityMetricThresholdBase # type: ignore - from ._models import DataQualityMonitoringSignal # type: ignore - from ._models import DataReferenceCredential # type: ignore - from ._models import DataVersionBase # type: ignore - from ._models import DataVersionBaseProperties # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import Databricks # type: ignore - from ._models import DatabricksComputeSecrets # type: ignore - from ._models import DatabricksComputeSecretsProperties # type: ignore - from ._models import DatabricksProperties # type: ignore - from ._models import DatabricksSchema # type: ignore - from ._models import Datastore # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreProperties # type: ignore - from ._models import DatastoreResourceArmPaginatedResult # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DefaultScaleSettings # type: ignore - from ._models import DeploymentLogs # type: ignore - from ._models import DeploymentLogsRequest # type: ignore - from ._models import DeploymentResourceConfiguration # type: ignore - from ._models import DestinationAsset # type: ignore - from ._models import DiagnoseRequestProperties # type: ignore - from ._models import DiagnoseResponseResult # type: ignore - from ._models import DiagnoseResponseResultValue # type: ignore - from ._models import DiagnoseResult # type: ignore - from ._models import DiagnoseWorkspaceParameters # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import Docker # type: ignore - from ._models import DockerCredential # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultUpdateProperties # type: ignore - from ._models import EncryptionProperty # type: ignore - from ._models import EncryptionUpdateProperties # type: ignore - from ._models import Endpoint # type: ignore - from ._models import EndpointAuthKeys # type: ignore - from ._models import EndpointAuthToken # type: ignore - from ._models import EndpointDeploymentModel # type: ignore - from ._models import EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointDeploymentResourceProperties # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResource # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointKeys # type: ignore - from ._models import EndpointModelDeprecationProperties # type: ignore - from ._models import EndpointModelProperties # type: ignore - from ._models import EndpointModelSkuCapacityProperties # type: ignore - from ._models import EndpointModelSkuProperties # type: ignore - from ._models import EndpointModelSkuRateLimitProperties # type: ignore - from ._models import EndpointModelSkuRateLimitRulePatternProperties # type: ignore - from ._models import EndpointModelSkuRateLimitRuleProperties # type: ignore - from ._models import EndpointModels # type: ignore - from ._models import EndpointPropertiesBase # type: ignore - from ._models import EndpointResourceProperties # type: ignore - from ._models import EndpointResourcePropertiesBasicResource # type: ignore - from ._models import EndpointResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointScheduleAction # type: ignore - from ._models import EnvironmentContainer # type: ignore - from ._models import EnvironmentContainerProperties # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVariable # type: ignore - from ._models import EnvironmentVersion # type: ignore - from ._models import EnvironmentVersionProperties # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import EstimatedVMPrice # type: ignore - from ._models import EstimatedVMPrices # type: ignore - from ._models import ExternalFQDNResponse # type: ignore - from ._models import FQDNEndpoint # type: ignore - from ._models import FQDNEndpointDetail # type: ignore - from ._models import FQDNEndpoints # type: ignore - from ._models import FQDNEndpointsPropertyBag # type: ignore - from ._models import Feature # type: ignore - from ._models import FeatureAttributionDriftMonitoringSignal # type: ignore - from ._models import FeatureAttributionMetricThreshold # type: ignore - from ._models import FeatureImportanceSettings # type: ignore - from ._models import FeatureProperties # type: ignore - from ._models import FeatureResourceArmPaginatedResult # type: ignore - from ._models import FeatureStoreSettings # type: ignore - from ._models import FeatureSubset # type: ignore - from ._models import FeatureWindow # type: ignore - from ._models import FeaturesetContainer # type: ignore - from ._models import FeaturesetContainerProperties # type: ignore - from ._models import FeaturesetContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturesetSpecification # type: ignore - from ._models import FeaturesetVersion # type: ignore - from ._models import FeaturesetVersionBackfillRequest # type: ignore - from ._models import FeaturesetVersionBackfillResponse # type: ignore - from ._models import FeaturesetVersionProperties # type: ignore - from ._models import FeaturesetVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityContainer # type: ignore - from ._models import FeaturestoreEntityContainerProperties # type: ignore - from ._models import FeaturestoreEntityContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityVersion # type: ignore - from ._models import FeaturestoreEntityVersionProperties # type: ignore - from ._models import FeaturestoreEntityVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturizationSettings # type: ignore - from ._models import FixedInputData # type: ignore - from ._models import FlavorData # type: ignore - from ._models import ForecastHorizon # type: ignore - from ._models import Forecasting # type: ignore - from ._models import ForecastingSettings # type: ignore - from ._models import ForecastingTrainingSettings # type: ignore - from ._models import FqdnOutboundRule # type: ignore - from ._models import GetBlobReferenceForConsumptionDto # type: ignore - from ._models import GetBlobReferenceSASRequestDto # type: ignore - from ._models import GetBlobReferenceSASResponseDto # type: ignore - from ._models import GridSamplingAlgorithm # type: ignore - from ._models import HDInsight # type: ignore - from ._models import HDInsightProperties # type: ignore - from ._models import HDInsightSchema # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import IdentityForCmk # type: ignore - from ._models import IdleShutdownSetting # type: ignore - from ._models import Image # type: ignore - from ._models import ImageClassification # type: ignore - from ._models import ImageClassificationBase # type: ignore - from ._models import ImageClassificationMultilabel # type: ignore - from ._models import ImageInstanceSegmentation # type: ignore - from ._models import ImageLimitSettings # type: ignore - from ._models import ImageMetadata # type: ignore - from ._models import ImageModelDistributionSettings # type: ignore - from ._models import ImageModelDistributionSettingsClassification # type: ignore - from ._models import ImageModelDistributionSettingsObjectDetection # type: ignore - from ._models import ImageModelSettings # type: ignore - from ._models import ImageModelSettingsClassification # type: ignore - from ._models import ImageModelSettingsObjectDetection # type: ignore - from ._models import ImageObjectDetection # type: ignore - from ._models import ImageObjectDetectionBase # type: ignore - from ._models import ImageSweepSettings # type: ignore - from ._models import ImageVertical # type: ignore - from ._models import IndexColumn # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import JobBase # type: ignore - from ._models import JobBaseProperties # type: ignore - from ._models import JobBaseResourceArmPaginatedResult # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobResourceConfiguration # type: ignore - from ._models import JobScheduleAction # type: ignore - from ._models import JobService # type: ignore - from ._models import JupyterKernelConfig # type: ignore - from ._models import KeyVaultProperties # type: ignore - from ._models import Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LakeHouseArtifact # type: ignore - from ._models import ListAmlUserFeatureResult # type: ignore - from ._models import ListNotebookKeysResult # type: ignore - from ._models import ListStorageAccountKeysResult # type: ignore - from ._models import ListUsagesResult # type: ignore - from ._models import ListWorkspaceKeysResult # type: ignore - from ._models import ListWorkspaceQuotas # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableData # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import ManagedComputeIdentity # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedIdentityCredential # type: ignore - from ._models import ManagedNetworkProvisionOptions # type: ignore - from ._models import ManagedNetworkProvisionStatus # type: ignore - from ._models import ManagedNetworkSettings # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedOnlineEndpointDeploymentResourceProperties # type: ignore - from ._models import ManagedOnlineEndpointResourceProperties # type: ignore - from ._models import ManagedResourceGroupAssignedIdentities # type: ignore - from ._models import ManagedResourceGroupSettings # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MarketplacePlan # type: ignore - from ._models import MarketplaceSubscription # type: ignore - from ._models import MarketplaceSubscriptionProperties # type: ignore - from ._models import MarketplaceSubscriptionResourceArmPaginatedResult # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelSettings # type: ignore - from ._models import ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import MonitorComputeConfigurationBase # type: ignore - from ._models import MonitorComputeIdentityBase # type: ignore - from ._models import MonitorDefinition # type: ignore - from ._models import MonitorEmailNotificationSettings # type: ignore - from ._models import MonitorNotificationSettings # type: ignore - from ._models import MonitorServerlessSparkCompute # type: ignore - from ._models import MonitoringFeatureFilterBase # type: ignore - from ._models import MonitoringInputDataBase # type: ignore - from ._models import MonitoringSignalBase # type: ignore - from ._models import MonitoringTarget # type: ignore - from ._models import MonitoringThreshold # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpVertical # type: ignore - from ._models import NlpVerticalFeaturizationSettings # type: ignore - from ._models import NlpVerticalLimitSettings # type: ignore - from ._models import NodeStateCounts # type: ignore - from ._models import Nodes # type: ignore - from ._models import NoneAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import NotebookAccessTokenResult # type: ignore - from ._models import NotebookPreparationError # type: ignore - from ._models import NotebookResourceInfo # type: ignore - from ._models import NotificationSetting # type: ignore - from ._models import NumericalDataDriftMetricThreshold # type: ignore - from ._models import NumericalDataQualityMetricThreshold # type: ignore - from ._models import NumericalPredictionDriftMetricThreshold # type: ignore - from ._models import OAuth2AuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import Objective # type: ignore - from ._models import OneLakeArtifact # type: ignore - from ._models import OneLakeDatastore # type: ignore - from ._models import OnlineDeployment # type: ignore - from ._models import OnlineDeploymentProperties # type: ignore - from ._models import OnlineDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineEndpoint # type: ignore - from ._models import OnlineEndpointProperties # type: ignore - from ._models import OnlineEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OpenAIEndpointDeploymentResourceProperties # type: ignore - from ._models import OpenAIEndpointResourceProperties # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OsPatchingStatus # type: ignore - from ._models import OutboundRule # type: ignore - from ._models import OutboundRuleBasicResource # type: ignore - from ._models import OutboundRuleListResult # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties # type: ignore - from ._models import PartialManagedServiceIdentity # type: ignore - from ._models import PartialMinimalTrackedResource # type: ignore - from ._models import PartialMinimalTrackedResourceWithIdentity # type: ignore - from ._models import PartialMinimalTrackedResourceWithSku # type: ignore - from ._models import PartialMinimalTrackedResourceWithSkuAndIdentity # type: ignore - from ._models import PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PendingUploadCredentialDto # type: ignore - from ._models import PendingUploadRequestDto # type: ignore - from ._models import PendingUploadResponseDto # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import PredictionDriftMetricThresholdBase # type: ignore - from ._models import PredictionDriftMonitoringSignal # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateEndpointDestination # type: ignore - from ._models import PrivateEndpointOutboundRule # type: ignore - from ._models import PrivateEndpointResource # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QueueSettings # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import RaiBlocklistConfig # type: ignore - from ._models import RaiBlocklistItemBulkRequest # type: ignore - from ._models import RaiBlocklistItemProperties # type: ignore - from ._models import RaiBlocklistItemPropertiesBasicResource # type: ignore - from ._models import RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RaiBlocklistProperties # type: ignore - from ._models import RaiBlocklistPropertiesBasicResource # type: ignore - from ._models import RaiBlocklistPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RaiPolicyContentFilter # type: ignore - from ._models import RaiPolicyProperties # type: ignore - from ._models import RaiPolicyPropertiesBasicResource # type: ignore - from ._models import RaiPolicyPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import Recurrence # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import RegenerateServiceAccountKeyContent # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryPartialManagedServiceIdentity # type: ignore - from ._models import RegistryPrivateEndpointConnection # type: ignore - from ._models import RegistryPrivateLinkServiceConnectionState # type: ignore - from ._models import RegistryRegionArmDetails # type: ignore - from ._models import RegistryTrackedResourceArmPaginatedResult # type: ignore - from ._models import Regression # type: ignore - from ._models import RegressionTrainingSettings # type: ignore - from ._models import RequestLogging # type: ignore - from ._models import ResizeSchema # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import ResourceId # type: ignore - from ._models import ResourceName # type: ignore - from ._models import ResourceQuota # type: ignore - from ._models import RollingInputData # type: ignore - from ._models import Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import SASCredential # type: ignore - from ._models import SASCredentialDto # type: ignore - from ._models import SamplingAlgorithm # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ScaleSettings # type: ignore - from ._models import ScaleSettingsInformation # type: ignore - from ._models import Schedule # type: ignore - from ._models import ScheduleActionBase # type: ignore - from ._models import ScheduleBase # type: ignore - from ._models import ScheduleProperties # type: ignore - from ._models import ScheduleResourceArmPaginatedResult # type: ignore - from ._models import ScriptReference # type: ignore - from ._models import ScriptsToExecute # type: ignore - from ._models import Seasonality # type: ignore - from ._models import SecretExpiry # type: ignore - from ._models import ServerlessComputeSettings # type: ignore - from ._models import ServerlessEndpoint # type: ignore - from ._models import ServerlessEndpointCapacityReservation # type: ignore - from ._models import ServerlessEndpointContentSafety # type: ignore - from ._models import ServerlessEndpointInferenceEndpoint # type: ignore - from ._models import ServerlessEndpointModelSettings # type: ignore - from ._models import ServerlessEndpointProperties # type: ignore - from ._models import ServerlessEndpointResourceProperties # type: ignore - from ._models import ServerlessEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import ServerlessInferenceEndpoint # type: ignore - from ._models import ServerlessOffer # type: ignore - from ._models import ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import ServiceTagDestination # type: ignore - from ._models import ServiceTagOutboundRule # type: ignore - from ._models import SetupScripts # type: ignore - from ._models import SharedPrivateLinkResource # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuResource # type: ignore - from ._models import SkuResourceArmPaginatedResult # type: ignore - from ._models import SkuSetting # type: ignore - from ._models import SparkJob # type: ignore - from ._models import SparkJobEntry # type: ignore - from ._models import SparkJobPythonEntry # type: ignore - from ._models import SparkJobScalaEntry # type: ignore - from ._models import SparkResourceConfiguration # type: ignore - from ._models import SpeechEndpointDeploymentResourceProperties # type: ignore - from ._models import SpeechEndpointResourceProperties # type: ignore - from ._models import SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StaticInputData # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SynapseSpark # type: ignore - from ._models import SynapseSparkProperties # type: ignore - from ._models import SystemCreatedAcrAccount # type: ignore - from ._models import SystemCreatedStorageAccount # type: ignore - from ._models import SystemData # type: ignore - from ._models import SystemService # type: ignore - from ._models import TableVertical # type: ignore - from ._models import TableVerticalFeaturizationSettings # type: ignore - from ._models import TableVerticalLimitSettings # type: ignore - from ._models import TargetLags # type: ignore - from ._models import TargetRollingWindowSize # type: ignore - from ._models import TargetUtilizationScaleSettings # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TextClassification # type: ignore - from ._models import TextClassificationMultilabel # type: ignore - from ._models import TextNer # type: ignore - from ._models import TmpfsOptions # type: ignore - from ._models import TopNFeaturesByAttribution # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UpdateWorkspaceQuotas # type: ignore - from ._models import UpdateWorkspaceQuotasResult # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageName # type: ignore - from ._models import UserAccountCredentials # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserCreatedAcrAccount # type: ignore - from ._models import UserCreatedStorageAccount # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import UsernamePasswordAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import VirtualMachine # type: ignore - from ._models import VirtualMachineImage # type: ignore - from ._models import VirtualMachineSchema # type: ignore - from ._models import VirtualMachineSchemaProperties # type: ignore - from ._models import VirtualMachineSecrets # type: ignore - from ._models import VirtualMachineSecretsSchema # type: ignore - from ._models import VirtualMachineSize # type: ignore - from ._models import VirtualMachineSizeListResult # type: ignore - from ._models import VirtualMachineSshCredentials # type: ignore - from ._models import VolumeDefinition # type: ignore - from ._models import VolumeOptions # type: ignore - from ._models import Webhook # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionAccountKey # type: ignore - from ._models import WorkspaceConnectionApiKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # type: ignore - from ._models import WorkspaceConnectionOAuth2 # type: ignore - from ._models import WorkspaceConnectionPersonalAccessToken # type: ignore - from ._models import WorkspaceConnectionPropertiesV2 # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResource # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult # type: ignore - from ._models import WorkspaceConnectionServicePrincipal # type: ignore - from ._models import WorkspaceConnectionSharedAccessSignature # type: ignore - from ._models import WorkspaceConnectionUpdateParameter # type: ignore - from ._models import WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceHubConfig # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspacePrivateEndpointResource # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - ActionType, - AllocationState, - AllowedContentLevel, - ApplicationSharingPolicy, - AssetProvisioningState, - AutoRebuildSetting, - Autosave, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeRecurrenceFrequency, - ComputeTriggerType, - ComputeType, - ComputeWeekDay, - ConnectionAuthType, - ConnectionCategory, - ConnectionGroup, - ContainerType, - ContentSafetyStatus, - CreatedByType, - CredentialsType, - DataAvailabilityStatus, - DataCollectionMode, - DataReferenceCredentialType, - DataType, - DatastoreType, - DefaultResourceProvisioningState, - DeploymentModelVersionUpgradeOption, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EndpointType, - EnvironmentType, - EnvironmentVariableType, - FeatureAttributionMetric, - FeatureDataType, - FeatureImportanceMode, - FeatureLags, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - ImageType, - InputDeliveryMode, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogVerbosity, - ManagedNetworkStatus, - ManagedPERequirement, - ManagedPEStatus, - ManagedServiceIdentityType, - MarketplaceSubscriptionProvisioningState, - MarketplaceSubscriptionStatus, - MaterializationStoreType, - MlflowAutologger, - ModelLifecycleStatus, - ModelSize, - ModelTaskType, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringNotificationType, - MonitoringSignalType, - MountAction, - MountMode, - MountState, - NCrossValidationsMode, - Network, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - Origin, - OsType, - OutputDeliveryMode, - PatchStatus, - PendingUploadCredentialType, - PendingUploadType, - PrivateEndpointConnectionProvisioningState, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccessType, - QuotaUnit, - RaiPolicyContentSource, - RaiPolicyMode, - RaiPolicyType, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleAction, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServerlessEndpointState, - ServerlessInferenceEndpointAuthMode, - ServiceAccountKeyName, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - VmPriority, - VolumeDefinitionType, - WebhookType, - WeekDay, -) - -__all__ = [ - 'AADAuthTypeWorkspaceConnectionProperties', - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountApiKeys', - 'AccountKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlToken', - 'AmlTokenComputeIdentity', - 'AmlUserFeature', - 'AnonymousAccessCredential', - 'ApiKeyAuthWorkspaceConnectionProperties', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CapacityConfig', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'CognitiveServiceEndpointDeploymentResourceProperties', - 'CognitiveServicesSku', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeRecurrenceSchedule', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'ContentSafety', - 'ContentSafetyEndpointDeploymentResourceProperties', - 'ContentSafetyEndpointResourceProperties', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CustomForecastHorizon', - 'CustomKeys', - 'CustomKeysWorkspaceConnectionProperties', - 'CustomMetricThreshold', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataReferenceCredential', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DestinationAsset', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'DockerCredential', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentModel', - 'EndpointDeploymentPropertiesBase', - 'EndpointDeploymentResourceProperties', - 'EndpointDeploymentResourcePropertiesBasicResource', - 'EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointKeys', - 'EndpointModelDeprecationProperties', - 'EndpointModelProperties', - 'EndpointModelSkuCapacityProperties', - 'EndpointModelSkuProperties', - 'EndpointModelSkuRateLimitProperties', - 'EndpointModelSkuRateLimitRulePatternProperties', - 'EndpointModelSkuRateLimitRuleProperties', - 'EndpointModels', - 'EndpointPropertiesBase', - 'EndpointResourceProperties', - 'EndpointResourcePropertiesBasicResource', - 'EndpointResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsPropertyBag', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureImportanceSettings', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionBackfillResponse', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FixedInputData', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GetBlobReferenceForConsumptionDto', - 'GetBlobReferenceSASRequestDto', - 'GetBlobReferenceSASResponseDto', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'IndexColumn', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'JupyterKernelConfig', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedComputeIdentity', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedIdentityCredential', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedOnlineEndpointDeploymentResourceProperties', - 'ManagedOnlineEndpointResourceProperties', - 'ManagedResourceGroupAssignedIdentities', - 'ManagedResourceGroupSettings', - 'ManagedServiceIdentity', - 'MarketplacePlan', - 'MarketplaceSubscription', - 'MarketplaceSubscriptionProperties', - 'MarketplaceSubscriptionResourceArmPaginatedResult', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelSettings', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorComputeConfigurationBase', - 'MonitorComputeIdentityBase', - 'MonitorDefinition', - 'MonitorEmailNotificationSettings', - 'MonitorNotificationSettings', - 'MonitorServerlessSparkCompute', - 'MonitoringFeatureFilterBase', - 'MonitoringInputDataBase', - 'MonitoringSignalBase', - 'MonitoringTarget', - 'MonitoringThreshold', - 'Mpi', - 'NCrossValidations', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'OAuth2AuthTypeWorkspaceConnectionProperties', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OpenAIEndpointDeploymentResourceProperties', - 'OpenAIEndpointResourceProperties', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OsPatchingStatus', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialMinimalTrackedResourceWithSkuAndIdentity', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProxyResource', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RaiBlocklistConfig', - 'RaiBlocklistItemBulkRequest', - 'RaiBlocklistItemProperties', - 'RaiBlocklistItemPropertiesBasicResource', - 'RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult', - 'RaiBlocklistProperties', - 'RaiBlocklistPropertiesBasicResource', - 'RaiBlocklistPropertiesBasicResourceArmPaginatedResult', - 'RaiPolicyContentFilter', - 'RaiPolicyProperties', - 'RaiPolicyPropertiesBasicResource', - 'RaiPolicyPropertiesBasicResourceArmPaginatedResult', - 'RandomSamplingAlgorithm', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'RegenerateServiceAccountKeyContent', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryPartialManagedServiceIdentity', - 'RegistryPrivateEndpointConnection', - 'RegistryPrivateLinkServiceConnectionState', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionTrainingSettings', - 'RequestLogging', - 'ResizeSchema', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'RollingInputData', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredential', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretExpiry', - 'ServerlessComputeSettings', - 'ServerlessEndpoint', - 'ServerlessEndpointCapacityReservation', - 'ServerlessEndpointContentSafety', - 'ServerlessEndpointInferenceEndpoint', - 'ServerlessEndpointModelSettings', - 'ServerlessEndpointProperties', - 'ServerlessEndpointResourceProperties', - 'ServerlessEndpointTrackedResourceArmPaginatedResult', - 'ServerlessInferenceEndpoint', - 'ServerlessOffer', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SpeechEndpointDeploymentResourceProperties', - 'SpeechEndpointResourceProperties', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StaticInputData', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionAccountKey', - 'WorkspaceConnectionApiKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionOAuth2', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUpdateParameter', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceHubConfig', - 'WorkspaceListResult', - 'WorkspacePrivateEndpointResource', - 'WorkspaceUpdateParameters', - 'ActionType', - 'AllocationState', - 'AllowedContentLevel', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoRebuildSetting', - 'Autosave', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeRecurrenceFrequency', - 'ComputeTriggerType', - 'ComputeType', - 'ComputeWeekDay', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ConnectionGroup', - 'ContainerType', - 'ContentSafetyStatus', - 'CreatedByType', - 'CredentialsType', - 'DataAvailabilityStatus', - 'DataCollectionMode', - 'DataReferenceCredentialType', - 'DataType', - 'DatastoreType', - 'DefaultResourceProvisioningState', - 'DeploymentModelVersionUpgradeOption', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EndpointType', - 'EnvironmentType', - 'EnvironmentVariableType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureImportanceMode', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'ManagedNetworkStatus', - 'ManagedPERequirement', - 'ManagedPEStatus', - 'ManagedServiceIdentityType', - 'MarketplaceSubscriptionProvisioningState', - 'MarketplaceSubscriptionStatus', - 'MaterializationStoreType', - 'MlflowAutologger', - 'ModelLifecycleStatus', - 'ModelSize', - 'ModelTaskType', - 'MonitorComputeIdentityType', - 'MonitorComputeType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataType', - 'MonitoringNotificationType', - 'MonitoringSignalType', - 'MountAction', - 'MountMode', - 'MountState', - 'NCrossValidationsMode', - 'Network', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'Origin', - 'OsType', - 'OutputDeliveryMode', - 'PatchStatus', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PrivateEndpointConnectionProvisioningState', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RaiPolicyContentSource', - 'RaiPolicyMode', - 'RaiPolicyType', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleAction', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServerlessEndpointState', - 'ServerlessInferenceEndpointAuthMode', - 'ServiceAccountKeyName', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index b2ffda132b51..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,2012 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from six import with_metaclass -from azure.core import CaseInsensitiveEnumMeta - - -class ActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ - - INTERNAL = "Internal" - -class AllocationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - RESIZING = "Resizing" - -class AllowedContentLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level at which content is filtered. - """ - - LOW = "Low" - MEDIUM = "Medium" - HIGH = "High" - -class ApplicationSharingPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - SHARED = "Shared" - -class AssetProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class AutoRebuildSetting(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoRebuild setting for the derived image - """ - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - -class Autosave(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -class BatchDeploymentConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated property types for batch deployments. - """ - - MODEL = "Model" - PIPELINE_COMPONENT = "PipelineComponent" - -class BatchLoggingLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class BatchOutputAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine how batch inferencing will handle output - """ - - SUMMARY_ONLY = "SummaryOnly" - APPEND_ROW = "AppendRow" - -class BillingCurrency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Target encoding for text data. - TEXT_TARGET_ENCODER = "TextTargetEncoder" - #: Ohe hot encoding creates a binary feature transformation. - ONE_HOT_ENCODER = "OneHotEncoder" - #: Target encoding for categorical data. - CAT_TARGET_ENCODER = "CatTargetEncoder" - #: Tf-Idf stands for, term-frequency times inverse document-frequency. This is a common term - #: weighting scheme for identifying information from documents. - TF_IDF = "TfIdf" - #: Weight of Evidence encoding is a technique used to encode categorical variables. It uses the - #: natural log of the P(1)/P(0) to create weights. - WO_E_TARGET_ENCODER = "WoETargetEncoder" - #: Label encoder converts labels/categorical variables in a numerical form. - LABEL_ENCODER = "LabelEncoder" - #: Word embedding helps represents words or phrases as a vector, or a series of numbers. - WORD_EMBEDDING = "WordEmbedding" - #: Naive Bayes is a classified that is used for classification of discrete features that are - #: categorically distributed. - NAIVE_BAYES = "NaiveBayes" - #: Count Vectorizer converts a collection of text documents to a matrix of token counts. - COUNT_VECTORIZER = "CountVectorizer" - #: Hashing One Hot Encoder can turn categorical variables into a limited number of new features. - #: This is often used for high-cardinality categorical features. - HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" - -class Caching(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class CategoricalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class CategoricalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class ClassificationModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Logistic regression is a fundamental classification technique. - #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear - #: regression. - #: Logistic regression is fast and relatively uncomplicated, and it's convenient for you to - #: interpret the results. - #: Although it's essentially a method for binary classification, it can also be applied to - #: multiclass problems. - LOGISTIC_REGRESSION = "LogisticRegression" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - SGD = "SGD" - #: The multinomial Naive Bayes classifier is suitable for classification with discrete features - #: (e.g., word counts for text classification). - #: The multinomial distribution normally requires integer feature counts. However, in practice, - #: fractional counts such as tf-idf may also work. - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - #: Naive Bayes classifier for multivariate Bernoulli models. - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - SVM = "SVM" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - #: Linear SVM performs best when input data is linear, i.e., data can be easily classified by - #: drawing the straight line between classified values on a plotted graph. - LINEAR_SVM = "LinearSVM" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: Random forest is a supervised learning algorithm. - #: The "forest"\\ it builds, is an ensemble of decision trees, usually trained with the - #: “bagging”\\ method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - #: target column values can be divided into distinct class values. - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - -class ClassificationMultilabelPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification multilabel tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - #: Intersection Over Union. Intersection of predictions divided by union of predictions. - IOU = "IOU" - -class ClassificationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - -class ClusterPurpose(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Intended usage of the cluster - """ - - FAST_PROD = "FastProd" - DENSE_PROD = "DenseProd" - DEV_TEST = "DevTest" - -class ComputeInstanceAuthorizationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Compute Instance Authorization type. Available values are personal (default). - """ - - PERSONAL = "personal" - -class ComputeInstanceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Current state of an ComputeInstance. - """ - - CREATING = "Creating" - CREATE_FAILED = "CreateFailed" - DELETING = "Deleting" - RUNNING = "Running" - RESTARTING = "Restarting" - RESIZING = "Resizing" - JOB_RUNNING = "JobRunning" - SETTING_UP = "SettingUp" - SETUP_FAILED = "SetupFailed" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - USER_SETTING_UP = "UserSettingUp" - USER_SETUP_FAILED = "UserSetupFailed" - UNKNOWN = "Unknown" - UNUSABLE = "Unusable" - -class ComputePowerAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """[Required] The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeRecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a compute recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ComputeTriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class ComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of compute - """ - - AKS = "AKS" - KUBERNETES = "Kubernetes" - AML_COMPUTE = "AmlCompute" - COMPUTE_INSTANCE = "ComputeInstance" - DATA_FACTORY = "DataFactory" - VIRTUAL_MACHINE = "VirtualMachine" - HD_INSIGHT = "HDInsight" - DATABRICKS = "Databricks" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - SYNAPSE_SPARK = "SynapseSpark" - -class ComputeWeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" - -class ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - ACCOUNT_KEY = "AccountKey" - SERVICE_PRINCIPAL = "ServicePrincipal" - ACCESS_KEY = "AccessKey" - API_KEY = "ApiKey" - CUSTOM_KEYS = "CustomKeys" - O_AUTH2 = "OAuth2" - AAD = "AAD" - -class ConnectionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - AZURE_MY_SQL_DB = "AzureMySqlDb" - AZURE_POSTGRES_DB = "AzurePostgresDb" - ADLS_GEN2 = "ADLSGen2" - REDIS = "Redis" - API_KEY = "ApiKey" - AZURE_OPEN_AI = "AzureOpenAI" - AI_SERVICES = "AIServices" - COGNITIVE_SEARCH = "CognitiveSearch" - COGNITIVE_SERVICE = "CognitiveService" - CUSTOM_KEYS = "CustomKeys" - AZURE_BLOB = "AzureBlob" - AZURE_ONE_LAKE = "AzureOneLake" - COSMOS_DB = "CosmosDb" - COSMOS_DB_MONGO_DB_API = "CosmosDbMongoDbApi" - AZURE_DATA_EXPLORER = "AzureDataExplorer" - AZURE_MARIA_DB = "AzureMariaDb" - AZURE_DATABRICKS_DELTA_LAKE = "AzureDatabricksDeltaLake" - AZURE_SQL_MI = "AzureSqlMi" - AZURE_TABLE_STORAGE = "AzureTableStorage" - AMAZON_RDS_FOR_ORACLE = "AmazonRdsForOracle" - AMAZON_RDS_FOR_SQL_SERVER = "AmazonRdsForSqlServer" - AMAZON_REDSHIFT = "AmazonRedshift" - DB2 = "Db2" - DRILL = "Drill" - GOOGLE_BIG_QUERY = "GoogleBigQuery" - GREENPLUM = "Greenplum" - HBASE = "Hbase" - HIVE = "Hive" - IMPALA = "Impala" - INFORMIX = "Informix" - MARIA_DB = "MariaDb" - MICROSOFT_ACCESS = "MicrosoftAccess" - MY_SQL = "MySql" - NETEZZA = "Netezza" - ORACLE = "Oracle" - PHOENIX = "Phoenix" - POSTGRE_SQL = "PostgreSql" - PRESTO = "Presto" - SAP_OPEN_HUB = "SapOpenHub" - SAP_BW = "SapBw" - SAP_HANA = "SapHana" - SAP_TABLE = "SapTable" - SPARK = "Spark" - SQL_SERVER = "SqlServer" - SYBASE = "Sybase" - TERADATA = "Teradata" - VERTICA = "Vertica" - CASSANDRA = "Cassandra" - COUCHBASE = "Couchbase" - MONGO_DB_V2 = "MongoDbV2" - MONGO_DB_ATLAS = "MongoDbAtlas" - AMAZON_S3_COMPATIBLE = "AmazonS3Compatible" - FILE_SERVER = "FileServer" - FTP_SERVER = "FtpServer" - GOOGLE_CLOUD_STORAGE = "GoogleCloudStorage" - HDFS = "Hdfs" - ORACLE_CLOUD_STORAGE = "OracleCloudStorage" - SFTP = "Sftp" - GENERIC_HTTP = "GenericHttp" - O_DATA_REST = "ODataRest" - ODBC = "Odbc" - GENERIC_REST = "GenericRest" - AMAZON_MWS = "AmazonMws" - CONCUR = "Concur" - DYNAMICS = "Dynamics" - DYNAMICS_AX = "DynamicsAx" - DYNAMICS_CRM = "DynamicsCrm" - GOOGLE_AD_WORDS = "GoogleAdWords" - HUBSPOT = "Hubspot" - JIRA = "Jira" - MAGENTO = "Magento" - MARKETO = "Marketo" - OFFICE365 = "Office365" - ELOQUA = "Eloqua" - RESPONSYS = "Responsys" - ORACLE_SERVICE_CLOUD = "OracleServiceCloud" - PAY_PAL = "PayPal" - QUICK_BOOKS = "QuickBooks" - SALESFORCE = "Salesforce" - SALESFORCE_SERVICE_CLOUD = "SalesforceServiceCloud" - SALESFORCE_MARKETING_CLOUD = "SalesforceMarketingCloud" - SAP_CLOUD_FOR_CUSTOMER = "SapCloudForCustomer" - SAP_ECC = "SapEcc" - SERVICE_NOW = "ServiceNow" - SHARE_POINT_ONLINE_LIST = "SharePointOnlineList" - SHOPIFY = "Shopify" - SQUARE = "Square" - WEB_TABLE = "WebTable" - XERO = "Xero" - ZOHO = "Zoho" - GENERIC_CONTAINER_REGISTRY = "GenericContainerRegistry" - OPEN_AI = "OpenAI" - SERP = "Serp" - BING_LLM_SEARCH = "BingLLMSearch" - SERVERLESS = "Serverless" - -class ConnectionGroup(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Group based on connection category - """ - - AZURE = "Azure" - AZURE_AI = "AzureAI" - DATABASE = "Database" - NO_SQL = "NoSQL" - FILE = "File" - GENERIC_PROTOCOL = "GenericProtocol" - SERVICES_AND_APPS = "ServicesAndApps" - -class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - STORAGE_INITIALIZER = "StorageInitializer" - INFERENCE_SERVER = "InferenceServer" - -class ContentSafetyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the status of content safety. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - -class DataAvailabilityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - PENDING = "Pending" - INCOMPLETE = "Incomplete" - COMPLETE = "Complete" - -class DataCollectionMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class DataReferenceCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the DataReference credentials type. - """ - - SAS = "SAS" - DOCKER_CREDENTIALS = "DockerCredentials" - MANAGED_IDENTITY = "ManagedIdentity" - NO_CREDENTIALS = "NoCredentials" - -class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - ONE_LAKE = "OneLake" - -class DataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - -class DefaultResourceProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NOT_STARTED = "NotStarted" - FAILED = "Failed" - CREATING = "Creating" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - DELETING = "Deleting" - ACCEPTED = "Accepted" - CANCELED = "Canceled" - SCALING = "Scaling" - DISABLED = "Disabled" - -class DeploymentModelVersionUpgradeOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Deployment model version upgrade option. - """ - - ONCE_NEW_DEFAULT_VERSION_AVAILABLE = "OnceNewDefaultVersionAvailable" - ONCE_CURRENT_VERSION_EXPIRED = "OnceCurrentVersionExpired" - NO_AUTO_UPGRADE = "NoAutoUpgrade" - -class DeploymentProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Possible values for DeploymentProvisioningState. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SCALING = "Scaling" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class DiagnoseResultLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -class DistributionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - -class EarlyTerminationPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EgressPublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EmailNotificationEnableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the email notification type. - """ - - JOB_COMPLETED = "JobCompleted" - JOB_FAILED = "JobFailed" - JOB_CANCELLED = "JobCancelled" - -class EncryptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AML_TOKEN = "AMLToken" - KEY = "Key" - AAD_TOKEN = "AADToken" - -class EndpointComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint compute type. - """ - - MANAGED = "Managed" - KUBERNETES = "Kubernetes" - AZURE_ML_COMPUTE = "AzureMLCompute" - -class EndpointProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of endpoint provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class EndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Connection status of the service consumer with the service provider - """ - - APPROVED = "Approved" - PENDING = "Pending" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - TIMEOUT = "Timeout" - -class EndpointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the endpoint. - """ - - AZURE_OPEN_AI = "Azure.OpenAI" - AZURE_SPEECH = "Azure.Speech" - AZURE_CONTENT_SAFETY = "Azure.ContentSafety" - AZURE_LLAMA = "Azure.Llama" - MANAGED_ONLINE_ENDPOINT = "managedOnlineEndpoint" - SERVERLESS_ENDPOINT = "serverlessEndpoint" - -class EnvironmentType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class EnvironmentVariableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class FeatureAttributionMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" - -class FeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - STRING = "String" - INTEGER = "Integer" - LONG = "Long" - FLOAT = "Float" - DOUBLE = "Double" - BINARY = "Binary" - DATETIME = "Datetime" - BOOLEAN = "Boolean" - -class FeatureImportanceMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The mode of operation for computing feature importance. - """ - - #: Disables computing feature importance within a signal. - DISABLED = "Disabled" - #: Enables computing feature importance within a signal. - ENABLED = "Enabled" - -class FeatureLags(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Flag for generating lags for the numeric features. - """ - - #: No feature lags generated. - NONE = "None" - #: System auto-generates feature lags. - AUTO = "Auto" - -class FeaturizationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Featurization mode - determines data featurization mode. - """ - - #: Auto mode, system performs featurization without any custom featurization inputs. - AUTO = "Auto" - #: Custom featurization. - CUSTOM = "Custom" - #: Featurization off. 'Forecasting' task cannot use this value. - OFF = "Off" - -class ForecastHorizonMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine forecast horizon selection mode. - """ - - #: Forecast horizon to be determined automatically. - AUTO = "Auto" - #: Use the custom forecast horizon. - CUSTOM = "Custom" - -class ForecastingModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all forecasting models supported by AutoML. - """ - - #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - #: statistical analysis to interpret the data and make future predictions. - #: This model aims to explain data by using time series data on its past values and uses linear - #: regression to make predictions. - AUTO_ARIMA = "AutoArima" - #: Prophet is a procedure for forecasting time series data based on an additive model where - #: non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. - #: It works best with time series that have strong seasonal effects and several seasons of - #: historical data. Prophet is robust to missing data and shifts in the trend, and typically - #: handles outliers well. - PROPHET = "Prophet" - #: The Naive forecasting model makes predictions by carrying forward the latest target value for - #: each time-series in the training data. - NAIVE = "Naive" - #: The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - #: target values for each time-series in the training data. - SEASONAL_NAIVE = "SeasonalNaive" - #: The Average forecasting model makes predictions by carrying forward the average of the target - #: values for each time-series in the training data. - AVERAGE = "Average" - #: The Seasonal Average forecasting model makes predictions by carrying forward the average value - #: of the latest season of data for each time-series in the training data. - SEASONAL_AVERAGE = "SeasonalAverage" - #: Exponential smoothing is a time series forecasting method for univariate data that can be - #: extended to support data with a systematic trend or seasonal component. - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - #: An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - #: viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - #: more moving average (MA) terms. - #: This method is suitable for forecasting when data is stationary/non stationary, and - #: multivariate with any type of data pattern, i.e., level/trend /seasonality/cyclicity. - ARIMAX = "Arimax" - #: TCNForecaster: Temporal Convolutional Networks Forecaster. //TODO: Ask forecasting team for - #: brief intro. - TCN_FORECASTER = "TCNForecaster" - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest"\\ it builds, is an ensemble of decision trees, usually trained with the - #: “bagging”\\ method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class ForecastingPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Forecasting task. - """ - - #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class Goal(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - USER_IDENTITY = "UserIdentity" - -class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - Environment images (custom and curated) - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class InputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class InstanceSegmentationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for InstanceSegmentation tasks. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class IsolationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Isolation mode for the managed network of a machine learning workspace. - """ - - DISABLED = "Disabled" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - -class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Input Type. - """ - - LITERAL = "literal" - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobLimitsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status of a job. - """ - - #: Run hasn't started yet. - NOT_STARTED = "NotStarted" - #: Run has started. The user has a run ID. - STARTING = "Starting" - #: (Not used currently) It will be used if ES is creating the compute target. - PROVISIONING = "Provisioning" - #: The run environment is being prepared. - PREPARING = "Preparing" - #: The job is queued in the compute target. For example, in BatchAI the job is in queued state, - #: while waiting for all required nodes to be ready. - QUEUED = "Queued" - #: The job started to run in the compute target. - RUNNING = "Running" - #: Job is completed in the target. It is in output collection state now. - FINALIZING = "Finalizing" - #: Cancellation has been requested for the job. - CANCEL_REQUESTED = "CancelRequested" - #: Job completed successfully. This reflects that both the job itself and output collection states - #: completed successfully. - COMPLETED = "Completed" - #: Job failed. - FAILED = "Failed" - #: Following cancellation request, the job is now successfully canceled. - CANCELED = "Canceled" - #: When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - #: goes to NotResponding state. - #: NotResponding is the only state that is exempt from strict transition orders. A run can go from - #: NotResponding to any of the previous states. - NOT_RESPONDING = "NotResponding" - #: The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. - PAUSED = "Paused" - #: Default job status if not mapped to all other statuses. - UNKNOWN = "Unknown" - -class JobTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job tier. - """ - - NULL = "Null" - SPOT = "Spot" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of job. - """ - - AUTO_ML = "AutoML" - COMMAND = "Command" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - -class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - PRIMARY = "Primary" - SECONDARY = "Secondary" - -class LearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Learning rate scheduler enum. - """ - - #: No learning rate scheduler selected. - NONE = "None" - #: Cosine Annealing With Warmup. - WARMUP_COSINE = "WarmupCosine" - #: Step learning rate scheduler. - STEP = "Step" - -class ListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class LoadBalancerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -class LogVerbosity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for setting log verbosity. - """ - - #: No logs emitted. - NOT_SET = "NotSet" - #: Debug and above log statements logged. - DEBUG = "Debug" - #: Info and above log statements logged. - INFO = "Info" - #: Warning and above log statements logged. - WARNING = "Warning" - #: Error and above log statements logged. - ERROR = "Error" - #: Only critical statements logged. - CRITICAL = "Critical" - -class ManagedNetworkStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status for the managed network of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class ManagedPERequirement(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - REQUIRED = "Required" - NOT_REQUIRED = "NotRequired" - NOT_APPLICABLE = "NotApplicable" - -class ManagedPEStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - INACTIVE = "Inactive" - ACTIVE = "Active" - NOT_APPLICABLE = "NotApplicable" - -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class MarketplaceSubscriptionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: MarketplaceSubscription is being created. - CREATING = "Creating" - #: MarketplaceSubscription is being deleted. - DELETING = "Deleting" - #: MarketplaceSubscription is successfully provisioned. - SUCCEEDED = "Succeeded" - #: MarketplaceSubscription provisioning failed. - FAILED = "Failed" - #: MarketplaceSubscription is being updated. - UPDATING = "Updating" - CANCELED = "Canceled" - -class MarketplaceSubscriptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The customer can now use the Marketplace Subscription's - #: model and will be billed. - SUBSCRIBED = "Subscribed" - #: The customer could not be billed for the Marketplace Subscription. - #: The customer will not be able to access the model. - SUSPENDED = "Suspended" - #: Marketplace Subscriptions reach this state in response to an explicit customer or CSP action. - #: A Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, - #: after being in the Suspended state for some time. - UNSUBSCRIBED = "Unsubscribed" - -class MaterializationStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - -class MlflowAutologger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ModelLifecycleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model lifecycle status. - """ - - GENERALLY_AVAILABLE = "GenerallyAvailable" - PREVIEW = "Preview" - -class ModelSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Image model size. - """ - - #: No value selected. - NONE = "None" - #: Small size. - SMALL = "Small" - #: Medium size. - MEDIUM = "Medium" - #: Large size. - LARGE = "Large" - #: Extra large size. - EXTRA_LARGE = "ExtraLarge" - -class ModelTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model task type enum. - """ - - CLASSIFICATION = "Classification" - REGRESSION = "Regression" - -class MonitorComputeIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute identity type enum. - """ - - #: Authenticates through user's AML token. - AML_TOKEN = "AmlToken" - #: Authenticates through a user-provided managed identity. - MANAGED_IDENTITY = "ManagedIdentity" - -class MonitorComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute type enum. - """ - - #: Serverless Spark compute. - SERVERLESS_SPARK = "ServerlessSpark" - -class MonitoringFeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Used for features of numerical data type. - NUMERICAL = "Numerical" - #: Used for features of categorical data type. - CATEGORICAL = "Categorical" - -class MonitoringFeatureFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Includes all features. - ALL_FEATURES = "AllFeatures" - #: Only includes the top contributing features, measured by feature attribution. - TOP_N_BY_ATTRIBUTION = "TopNByAttribution" - #: Includes a user-defined subset of features. - FEATURE_SUBSET = "FeatureSubset" - -class MonitoringInputDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitoring input data type enum. - """ - - #: An input data with a fixed window size. - STATIC = "Static" - #: An input data which rolls relatively to the monitor's current run time. - ROLLING = "Rolling" - #: An input data with tabular format which doesn't require preprocessing. - FIXED = "Fixed" - -class MonitoringNotificationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enables email notifications through AML notifications. - AML_NOTIFICATION = "AmlNotification" - -class MonitoringSignalType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Tracks model input data distribution change, comparing against training data or past production - #: data. - DATA_DRIFT = "DataDrift" - #: Tracks prediction result data distribution change, comparing against validation/test label data - #: or past production data. - PREDICTION_DRIFT = "PredictionDrift" - #: Tracks model input data integrity. - DATA_QUALITY = "DataQuality" - #: Tracks feature importance change in production, comparing against feature importance at - #: training time. - FEATURE_ATTRIBUTION_DRIFT = "FeatureAttributionDrift" - #: Tracks a custom signal provided by users. - CUSTOM = "Custom" - -class MountAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Mode. - """ - - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class MountState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -class NCrossValidationsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Determines how N-Cross validations value is determined. - """ - - #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - #: task. - AUTO = "Auto" - #: Use custom N-Cross validations value. - CUSTOM = "Custom" - -class Network(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NodeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - RUNNING = "running" - PREPARING = "preparing" - UNUSABLE = "unusable" - LEAVING = "leaving" - PREEMPTED = "preempted" - -class NodesValueType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated types for the nodes value - """ - - ALL = "All" - -class NumericalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class NumericalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class NumericalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class ObjectDetectionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Image ObjectDetection task. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class OneLakeArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine OneLake artifact type. - """ - - LAKE_HOUSE = "LakeHouse" - -class OperatingSystemType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OperationName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Name of the last operation. - """ - - CREATE = "Create" - START = "Start" - STOP = "Stop" - RESTART = "Restart" - RESIZE = "Resize" - REIMAGE = "Reimage" - DELETE = "Delete" - -class OperationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operation status. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CREATE_FAILED = "CreateFailed" - START_FAILED = "StartFailed" - STOP_FAILED = "StopFailed" - RESTART_FAILED = "RestartFailed" - RESIZE_FAILED = "ResizeFailed" - REIMAGE_FAILED = "ReimageFailed" - DELETE_FAILED = "DeleteFailed" - -class OperationTrigger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class Origin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - -class OsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -class PatchStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The os patching status. - """ - - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - UNKNOWN = "Unknown" - -class PendingUploadCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the PendingUpload credentials type. - """ - - SAS = "SAS" - -class PendingUploadType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of storage to use for the pending upload location - """ - - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - -class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - -class Protocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, - Succeeded, and Failed. - """ - - UNKNOWN = "Unknown" - UPDATING = "Updating" - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -class RaiPolicyContentSource(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content source to apply the Content Filters. - """ - - PROMPT = "Prompt" - COMPLETION = "Completion" - -class RaiPolicyMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content Filters mode. - """ - - DEFAULT = "Default" - DEFERRED = "Deferred" - BLOCKING = "Blocking" - -class RaiPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content Filters policy type. - """ - - USER_MANAGED = "UserManaged" - SYSTEM_MANAGED = "SystemManaged" - -class RandomSamplingAlgorithmRule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The specific type of random algorithm - """ - - RANDOM = "Random" - SOBOL = "Sobol" - -class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ReferenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class RegressionModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all Regression models supported by AutoML. - """ - - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest"\\ it builds, is an ensemble of decision trees, usually trained with the - #: “bagging”\\ method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class RegressionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Regression task. - """ - - #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class RemoteLoginPortPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_SPECIFIED = "NotSpecified" - -class RollingRateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - YEAR = "Year" - MONTH = "Month" - DAY = "Day" - HOUR = "Hour" - MINUTE = "Minute" - -class RuleAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The action enum for networking rule. - """ - - ALLOW = "Allow" - DENY = "Deny" - -class RuleCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ - - REQUIRED = "Required" - RECOMMENDED = "Recommended" - USER_DEFINED = "UserDefined" - DEPENDENCY = "Dependency" - -class RuleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class RuleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - FQDN = "FQDN" - PRIVATE_ENDPOINT = "PrivateEndpoint" - SERVICE_TAG = "ServiceTag" - -class SamplingAlgorithmType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - CREATE_MONITOR = "CreateMonitor" - -class ScheduleListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SeasonalityMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Forecasting seasonality mode. - """ - - #: Seasonality to be determined automatically. - AUTO = "Auto" - #: Use the custom seasonality value. - CUSTOM = "Custom" - -class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - -class ServerlessEndpointState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the Serverless Endpoint. - """ - - UNKNOWN = "Unknown" - CREATING = "Creating" - DELETING = "Deleting" - SUSPENDING = "Suspending" - REINSTATING = "Reinstating" - ONLINE = "Online" - SUSPENDED = "Suspended" - CREATION_FAILED = "CreationFailed" - DELETION_FAILED = "DeletionFailed" - -class ServerlessInferenceEndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY = "Key" - -class ServiceAccountKeyName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY1 = "Key1" - KEY2 = "Key2" - -class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Do not use any identity for service data access. - NONE = "None" - #: Use the system assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - #: Use the user assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - -class ShortSeriesHandlingConfiguration(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The parameter defining how if AutoML should handle short time series. - """ - - #: Represents no/null value. - NONE = "None" - #: Short series will be padded if there are no long series, otherwise short series will be - #: dropped. - AUTO = "Auto" - #: All the short series will be padded. - PAD = "Pad" - #: All the short series will be dropped. - DROP = "Drop" - -class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Node scaling setting for the compute sku. - """ - - #: Automatically scales node count. - AUTOMATIC = "Automatic" - #: Node count scaled upon user request. - MANUAL = "Manual" - #: Fixed set of nodes. - NONE = "None" - -class SkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class SourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -class SshPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SslConfigStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - AUTO = "Auto" - -class StackMetaLearnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). - This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression - """ - - NONE = "None" - #: Default meta-learners are LogisticRegression for classification tasks. - LOGISTIC_REGRESSION = "LogisticRegression" - #: Default meta-learners are LogisticRegression for classification task when CV is on. - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - #: Default meta-learners are LogisticRegression for regression task. - ELASTIC_NET = "ElasticNet" - #: Default meta-learners are LogisticRegression for regression task when CV is on. - ELASTIC_NET_CV = "ElasticNetCV" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - LINEAR_REGRESSION = "LinearRegression" - -class Status(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status of update workspace quota. - """ - - UNDEFINED = "Undefined" - SUCCESS = "Success" - FAILURE = "Failure" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - -class StochasticOptimizer(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Stochastic optimizer for image models. - """ - - #: No optimizer selected. - NONE = "None" - #: Stochastic Gradient Descent optimizer. - SGD = "Sgd" - #: Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - #: moments. - ADAM = "Adam" - #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. - ADAMW = "Adamw" - -class StorageAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -class TargetAggregationFunction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target aggregate function. - """ - - #: Represent no value set. - NONE = "None" - SUM = "Sum" - MAX = "Max" - MIN = "Min" - MEAN = "Mean" - -class TargetLagsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target lags selection modes. - """ - - #: Target lags to be determined automatically. - AUTO = "Auto" - #: Use the custom target lags. - CUSTOM = "Custom" - -class TargetRollingWindowSizeMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target rolling windows size mode. - """ - - #: Determine rolling windows size automatically. - AUTO = "Auto" - #: Use the specified rolling window size. - CUSTOM = "Custom" - -class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoMLJob Task type. - """ - - #: Classification in machine learning and statistics is a supervised learning approach in which - #: the computer program learns from the data given to it and make new observations or - #: classifications. - CLASSIFICATION = "Classification" - #: Regression means to predict the value using the input data. Regression models are used to - #: predict a continuous value. - REGRESSION = "Regression" - #: Forecasting is a special kind of regression task that deals with time-series data and creates - #: forecasting model - #: that can be used to predict the near future values based on the inputs. - FORECASTING = "Forecasting" - #: Image Classification. Multi-class image classification is used when an image is classified with - #: only a single label - #: from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - #: or a 'duck'. - IMAGE_CLASSIFICATION = "ImageClassification" - #: Image Classification Multilabel. Multi-label image classification is used when an image could - #: have one or more labels - #: from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - #: Image Object Detection. Object detection is used to identify objects in an image and locate - #: each object with a - #: bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - #: Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - #: the pixel level, - #: drawing a polygon around each object in the image. - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - #: Text classification (also known as text tagging or text categorization) is the process of - #: sorting texts into categories. - #: Categories are mutually exclusive. - TEXT_CLASSIFICATION = "TextClassification" - #: Multilabel classification task assigns each sample to a group (zero or more) of target labels. - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - #: Text Named Entity Recognition a.k.a. TextNER. - #: Named Entity Recognition (NER) is the ability to take free-form text and identify the - #: occurrences of entities such as people, locations, organizations, and more. - TEXT_NER = "TextNER" - -class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class UnderlyingResourceAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DELETE = "Delete" - DETACH = "Detach" - -class UnitOfMeasure(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The unit of time measurement for the specified VM price. Example: OneHour - """ - - ONE_HOUR = "OneHour" - -class UsageUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of usage measurement. - """ - - COUNT = "Count" - -class UseStl(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Configure STL Decomposition of the time-series target column. - """ - - #: No stl decomposition. - NONE = "None" - SEASON = "Season" - SEASON_TREND = "SeasonTrend" - -class ValidationMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Metric computation method to use for validation metrics in image tasks. - """ - - #: No metric. - NONE = "None" - #: Coco metric. - COCO = "Coco" - #: Voc metric. - VOC = "Voc" - #: CocoVoc metric. - COCO_VOC = "CocoVoc" - -class VMPriceOSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operating system type used by the VM. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class VmPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Virtual Machine priority - """ - - DEDICATED = "Dedicated" - LOW_PRIORITY = "LowPriority" - -class VMTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of the VM. - """ - - STANDARD = "Standard" - LOW_PRIORITY = "LowPriority" - SPOT = "Spot" - -class VolumeDefinitionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class WebhookType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the webhook callback service type. - """ - - AZURE_DEV_OPS = "AzureDevOps" - -class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py deleted file mode 100644 index 6a382c7e1252..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py +++ /dev/null @@ -1,31310 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.created_by_workspace_arm_id = None - self.error = kwargs.get('error', None) - self.expiry_time = kwargs.get('expiry_time', None) - self.group = None - self.is_shared_to_all = kwargs.get('is_shared_to_all', None) - self.metadata = kwargs.get('metadata', None) - self.pe_requirement = kwargs.get('pe_requirement', None) - self.pe_status = kwargs.get('pe_status', None) - self.shared_user_list = kwargs.get('shared_user_list', None) - self.target = kwargs.get('target', None) - self.use_workspace_managed_identity = kwargs.get('use_workspace_managed_identity', None) - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Account key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccountKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Account key object for workspace connection credential. - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) - self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = kwargs.get('notification_setting', None) - self.services = kwargs.get('services', None) - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = kwargs.get('event_type', None) - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(**kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.deployment_configuration = kwargs.get('deployment_configuration', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") - self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = kwargs.get('component_id', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.tags = kwargs.get('tags', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = kwargs.get('minimum', None) - self.maximum = kwargs.get('maximum', None) - self.step = kwargs.get('step', None) - self.default = kwargs.get('default', None) - self.allowed_values = kwargs.get('allowed_values', None) - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.data_collection_mode = kwargs.get('data_collection_mode', None) - self.data_id = kwargs.get('data_id', None) - self.sampling_rate = kwargs.get('sampling_rate', 1) - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - self.provisioning_state = None - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.mount_mode = kwargs.get('mount_mode', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.enable_os_patching = kwargs.get('enable_os_patching', False) - self.enable_root_access = kwargs.get('enable_root_access', True) - self.enable_sso = kwargs.get('enable_sso', True) - self.release_quota_on_stop = kwargs.get('release_quota_on_stop', False) - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) - self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) - - -class ContentSafety(msrest.serialization.Model): - """ContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ContentSafety, self).__init__(**kwargs) - self.content_safety_status = kwargs['content_safety_status'] - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties, ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties', 'serverlessEndpoint': 'ServerlessEndpointResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = kwargs.get('associated_resource_id', None) - self.deployments = kwargs.get('deployments', None) - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = kwargs.get('endpoint_uri', None) - self.failure_reason = kwargs.get('failure_reason', None) - self.location = kwargs.get('location', None) - self.name = kwargs.get('name', None) - self.provisioning_state = None - self.should_create_ai_services_endpoint = kwargs.get('should_create_ai_services_endpoint', None) - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = kwargs['monitor_definition'] - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = kwargs.get('credentials', None) - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = kwargs.get('notification_types', None) - self.properties = kwargs.get('properties', None) - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] Reference to the component asset used to calculate the - custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] Reference to the component asset used to calculate - the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - super(CustomMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = kwargs['component_id'] - self.input_assets = kwargs.get('input_assets', None) - self.inputs = kwargs.get('inputs', None) - self.metric_thresholds = kwargs['metric_thresholds'] - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) - self.kernel = kwargs.get('kernel', None) - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.request_logging = kwargs.get('request_logging', None) - self.rolling_rate = kwargs.get('rolling_rate', None) - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = kwargs.get('destination_name', None) - self.destination_version = kwargs.get('destination_version', None) - self.registry_name = kwargs.get('registry_name', None) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.key_vault = kwargs.get('key_vault', None) - self.nsg = kwargs.get('nsg', None) - self.others = kwargs.get('others', None) - self.required_resource_providers = kwargs.get('required_resource_providers', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.storage_account = kwargs.get('storage_account', None) - self.udr = kwargs.get('udr', None) - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = kwargs.get('password', None) - self.user_name = kwargs.get('user_name', None) - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = kwargs.get('cosmos_db_resource_id', None) - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - self.search_account_resource_id = kwargs.get('search_account_resource_id', None) - self.status = kwargs['status'] - self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - self.version = kwargs.get('version', None) - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class EndpointModelDeprecationProperties(msrest.serialization.Model): - """EndpointModelDeprecationProperties. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: ~datetime.datetime - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: ~datetime.datetime - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'iso-8601'}, - 'inference': {'key': 'inference', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: ~datetime.datetime - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: ~datetime.datetime - """ - super(EndpointModelDeprecationProperties, self).__init__(**kwargs) - self.fine_tune = kwargs.get('fine_tune', None) - self.inference = kwargs.get('inference', None) - - -class EndpointModelProperties(msrest.serialization.Model): - """Endpoint Model properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar deprecation: - :vartype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar format: Deployment model format. - :vartype format: str - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar name: Deployment model name. - :vartype name: str - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'EndpointModelDeprecationProperties'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'format': {'key': 'format', 'type': 'str'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'skus': {'key': 'skus', 'type': '[EndpointModelSkuProperties]'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword deprecation: - :paramtype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword format: Deployment model format. - :paramtype format: str - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword name: Deployment model name. - :paramtype name: str - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - """ - super(EndpointModelProperties, self).__init__(**kwargs) - self.capabilities = kwargs.get('capabilities', None) - self.deprecation = kwargs.get('deprecation', None) - self.finetune_capabilities = kwargs.get('finetune_capabilities', None) - self.format = kwargs.get('format', None) - self.is_default_version = kwargs.get('is_default_version', None) - self.lifecycle_status = kwargs.get('lifecycle_status', None) - self.max_capacity = kwargs.get('max_capacity', None) - self.name = kwargs.get('name', None) - self.skus = kwargs.get('skus', None) - self.system_data = None - self.version = kwargs.get('version', None) - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointModelProperties]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointModelSkuCapacityProperties(msrest.serialization.Model): - """EndpointModelSkuCapacityProperties. - - :ivar default: The default capacity. - :vartype default: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: The default capacity. - :paramtype default: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - """ - super(EndpointModelSkuCapacityProperties, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.maximum = kwargs.get('maximum', None) - - -class EndpointModelSkuProperties(msrest.serialization.Model): - """EndpointModelSkuProperties. - - :ivar capacity: - :vartype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :ivar connection_ids: The list of ARM id for the connection support this SKU. - :vartype connection_ids: list[str] - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar name: The name of the model SKU. - :vartype name: str - :ivar rate_limits: - :vartype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'EndpointModelSkuCapacityProperties'}, - 'connection_ids': {'key': 'connectionIds', 'type': '[str]'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[EndpointModelSkuRateLimitProperties]'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :keyword connection_ids: The list of ARM id for the connection support this SKU. - :paramtype connection_ids: list[str] - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword rate_limits: - :paramtype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - """ - super(EndpointModelSkuProperties, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.connection_ids = kwargs.get('connection_ids', None) - self.deprecation_date = kwargs.get('deprecation_date', None) - self.name = kwargs.get('name', None) - self.rate_limits = kwargs.get('rate_limits', None) - self.usage_name = kwargs.get('usage_name', None) - - -class EndpointModelSkuRateLimitProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitProperties. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: The call rate limit for the model. - :vartype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[EndpointModelSkuRateLimitRuleProperties]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: The call rate limit for the model. - :paramtype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - super(EndpointModelSkuRateLimitProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.renewal_period = kwargs.get('renewal_period', None) - self.rules = kwargs.get('rules', None) - - -class EndpointModelSkuRateLimitRulePatternProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRulePatternProperties. - - :ivar method: - :vartype method: str - :ivar path: - :vartype path: str - """ - - _attribute_map = { - 'method': {'key': 'method', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword method: - :paramtype method: str - :keyword path: - :paramtype path: str - """ - super(EndpointModelSkuRateLimitRulePatternProperties, self).__init__(**kwargs) - self.method = kwargs.get('method', None) - self.path = kwargs.get('path', None) - - -class EndpointModelSkuRateLimitRuleProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRuleProperties. - - :ivar count: - :vartype count: float - :ivar dynamic_throttling_enabled: If the dynamic throttling is enabled. - :vartype dynamic_throttling_enabled: bool - :ivar key: - :vartype key: str - :ivar match_patterns: - :vartype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :ivar min_count: - :vartype min_count: float - :ivar renewal_period: - :vartype renewal_period: float - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'key': {'key': 'key', 'type': 'str'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[EndpointModelSkuRateLimitRulePatternProperties]'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: - :paramtype count: float - :keyword dynamic_throttling_enabled: If the dynamic throttling is enabled. - :paramtype dynamic_throttling_enabled: bool - :keyword key: - :paramtype key: str - :keyword match_patterns: - :paramtype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :keyword min_count: - :paramtype min_count: float - :keyword renewal_period: - :paramtype renewal_period: float - """ - super(EndpointModelSkuRateLimitRuleProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.dynamic_throttling_enabled = kwargs.get('dynamic_throttling_enabled', None) - self.key = kwargs.get('key', None) - self.match_patterns = kwargs.get('match_patterns', None) - self.min_count = kwargs.get('min_count', None) - self.renewal_period = kwargs.get('renewal_period', None) - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs['feature_importance_settings'] - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.target_column = kwargs.get('target_column', None) - - -class FeatureProperties(ResourceBase): - """DTO object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(**kwargs) - self.data_type = kwargs.get('data_type', None) - self.feature_name = kwargs.get('feature_name', None) - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetContainerProperties(AssetContainer): - """DTO object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetSpecification(msrest.serialization.Model): - """DTO object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = kwargs.get('data_availability_status', None) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.properties = kwargs.get('properties', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', None) - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = kwargs.get('job_ids', None) - - -class FeaturesetVersionProperties(AssetBase): - """DTO object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.materialization_settings = kwargs.get('materialization_settings', None) - self.provisioning_state = None - self.specification = kwargs.get('specification', None) - self.stage = kwargs.get('stage', None) - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """DTO object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityVersionProperties(AssetBase): - """DTO object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get('index_columns', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = kwargs['features'] - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = kwargs.get('feature_window_end', None) - self.feature_window_start = kwargs.get('feature_window_start', None) - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) - self.data_context = kwargs.get('data_context', None) - self.input_data_type = None # type: Optional[str] - self.job_input_type = kwargs['job_input_type'] - self.uri = kwargs['uri'] - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(**kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.parent_rule_names = None - self.status = kwargs.get('status', None) - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.blob_uri = kwargs.get('blob_uri', None) - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) - self.version = kwargs.get('version', None) - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class IndexColumn(msrest.serialization.Model): - """DTO object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.data_type = kwargs.get('data_type', None) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = kwargs.get('argv', None) - self.display_name = kwargs.get('display_name', None) - self.language = kwargs.get('language', None) - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = kwargs.get('identity_client_id', None) - self.key_identifier = kwargs['key_identifier'] - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.data_collector = kwargs.get('data_collector', None) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = kwargs['artifact_name'] - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(**kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = kwargs.get('container_registry_credentials', None) - self.notebook_access_keys = kwargs.get('notebook_access_keys', None) - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: The identity which will be leveraged by the monitoring jobs. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity which will be leveraged by the monitoring jobs. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = kwargs.get('identity', None) - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = kwargs.get('managed_identity_type', None) - self.user_managed_identity_client_id = kwargs.get('user_managed_identity_client_id', None) - self.user_managed_identity_principal_id = kwargs.get('user_managed_identity_principal_id', None) - self.user_managed_identity_resource_id = kwargs.get('user_managed_identity_resource_id', None) - self.user_managed_identity_tenant_id = kwargs.get('user_managed_identity_tenant_id', None) - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = kwargs.get('spark_ready', None) - self.status = kwargs.get('status', None) - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = kwargs.get('isolation_mode', None) - self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - :ivar endpoint_compute_type: Enum to determine endpoint compute type. Possible values include: - "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar model: - :vartype model: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword endpoint_compute_type: Enum to determine endpoint compute type. Possible values - include: "Managed", "Kubernetes", "AzureMLCompute". - :paramtype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :keyword model: - :paramtype model: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.type = 'managedOnlineEndpoint' # type: str - self.endpoint_compute_type = kwargs.get('endpoint_compute_type', None) - self.model = kwargs.get('model', None) - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar compute: - :vartype compute: str - :ivar description: - :vartype description: str - :ivar mirror_traffic: Dictionary of :code:``. - :vartype mirror_traffic: dict[str, int] - :ivar scoring_uri: - :vartype scoring_uri: str - :ivar traffic: Dictionary of :code:``. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword compute: - :paramtype compute: str - :keyword description: - :paramtype description: str - :keyword mirror_traffic: Dictionary of :code:``. - :paramtype mirror_traffic: dict[str, int] - :keyword scoring_uri: - :paramtype scoring_uri: str - :keyword traffic: Dictionary of :code:``. - :paramtype traffic: dict[str, int] - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - self.auth_mode = kwargs.get('auth_mode', None) - self.compute = kwargs.get('compute', None) - self.description = kwargs.get('description', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.scoring_uri = kwargs.get('scoring_uri', None) - self.traffic = kwargs.get('traffic', None) - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = None - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = kwargs.get('assigned_identities', None) - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The identifying name of the Offer of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The identifying name of the Plan of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The identifying name of the Publisher of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = kwargs['model_id'] - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MaterializationComputeResource(msrest.serialization.Model): - """DTO object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = kwargs.get('notification', None) - self.resource = kwargs.get('resource', None) - self.schedule = kwargs.get('schedule', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.store_type = kwargs.get('store_type', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - :ivar model_id: The unique model identifier that this ServerlessEndpoint should provision. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: The unique model identifier that this ServerlessEndpoint should provision. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The entities targeted by the monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The entities targeted by the monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = kwargs.get('alert_notification_settings', None) - self.compute_configuration = kwargs['compute_configuration'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: The email recipient list which has a limitation of 499 characters in total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword emails: The email recipient list which has a limitation of 499 characters in total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = kwargs.get('emails', None) - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: Reference to the deployment asset targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: Reference to the model asset targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_id: Reference to the deployment asset targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: Reference to the model asset targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = kwargs.get('deployment_id', None) - self.model_id = kwargs.get('model_id', None) - self.task_type = kwargs['task_type'] - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = kwargs.get('email_notification_settings', None) - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = kwargs['compute_identity'] - self.instance_type = kwargs['instance_type'] - self.runtime_version = kwargs['runtime_version'] - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(**kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.is_private_link_enabled = kwargs.get('is_private_link_enabled', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) - self.resource_id = kwargs.get('resource_id', None) - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get('email_on', None) - self.emails = kwargs.get('emails', None) - self.webhooks = kwargs.get('webhooks', None) - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = kwargs.get('credentials', None) - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(**kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = kwargs['artifact'] - self.endpoint = kwargs.get('endpoint', None) - self.one_lake_workspace_name = kwargs['one_lake_workspace_name'] - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(OpenAIEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = kwargs.get('display', None) - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - :ivar os_patching_errors: Collection of errors encountered when doing os patching. - :vartype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - 'os_patching_errors': {'key': 'osPatchingErrors', 'type': '[ErrorResponse]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - :keyword os_patching_errors: Collection of errors encountered when doing os patching. - :paramtype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = kwargs.get('patch_status', None) - self.latest_patch_time = kwargs.get('latest_patch_time', None) - self.reboot_pending = kwargs.get('reboot_pending', None) - self.scheduled_reboot_time = kwargs.get('scheduled_reboot_time', None) - self.os_patching_errors = kwargs.get('os_patching_errors', None) - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) - self.subresource_target = kwargs.get('subresource_target', None) - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :ivar fqdns: - :vartype fqdns: list[str] - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - 'fqdns': {'key': 'fqdns', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :keyword fqdns: - :paramtype fqdns: list[str] - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) - self.fqdns = kwargs.get('fqdns', None) - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) - - -class RaiBlocklistConfig(msrest.serialization.Model): - """Azure OpenAI blocklist config. - - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - """ - - _attribute_map = { - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'blocklist_name': {'key': 'blocklistName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword blocklist_name: Name of ContentFilter. - :paramtype blocklist_name: str - """ - super(RaiBlocklistConfig, self).__init__(**kwargs) - self.blocking = kwargs.get('blocking', None) - self.blocklist_name = kwargs.get('blocklist_name', None) - - -class RaiBlocklistItemBulkRequest(msrest.serialization.Model): - """The Cognitive Services RaiBlocklist Item request body. - - :ivar name: - :vartype name: str - :ivar properties: Properties of Cognitive Services RaiBlocklist Item. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: - :paramtype name: str - :keyword properties: Properties of Cognitive Services RaiBlocklist Item. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemBulkRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.properties = kwargs.get('properties', None) - - -class RaiBlocklistItemProperties(msrest.serialization.Model): - """RAI Custom Blocklist Item properties. - - :ivar is_regex: If the pattern is a regex pattern. - :vartype is_regex: bool - :ivar pattern: Pattern to match against. - :vartype pattern: str - """ - - _attribute_map = { - 'is_regex': {'key': 'isRegex', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword is_regex: If the pattern is a regex pattern. - :paramtype is_regex: bool - :keyword pattern: Pattern to match against. - :paramtype pattern: str - """ - super(RaiBlocklistItemProperties, self).__init__(**kwargs) - self.is_regex = kwargs.get('is_regex', None) - self.pattern = kwargs.get('pattern', None) - - -class RaiBlocklistItemPropertiesBasicResource(Resource): - """RaiBlocklistItemPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist Item properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist Item properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistItemPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - super(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RaiBlocklistProperties(msrest.serialization.Model): - """RAI Custom Blocklist properties. - - :ivar description: Description of the block list. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the block list. - :paramtype description: str - """ - super(RaiBlocklistProperties, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class RaiBlocklistPropertiesBasicResource(Resource): - """RaiBlocklistPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - super(RaiBlocklistPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiBlocklistPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - super(RaiBlocklistPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RaiPolicyContentFilter(msrest.serialization.Model): - """Azure OpenAI Content Filter. - - :ivar allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :vartype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar enabled: If the ContentFilter is enabled. - :vartype enabled: bool - :ivar name: Name of ContentFilter. - :vartype name: str - :ivar source: Content source to apply the Content Filters. Possible values include: "Prompt", - "Completion". - :vartype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - - _attribute_map = { - 'allowed_content_level': {'key': 'allowedContentLevel', 'type': 'str'}, - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :paramtype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword enabled: If the ContentFilter is enabled. - :paramtype enabled: bool - :keyword name: Name of ContentFilter. - :paramtype name: str - :keyword source: Content source to apply the Content Filters. Possible values include: - "Prompt", "Completion". - :paramtype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - super(RaiPolicyContentFilter, self).__init__(**kwargs) - self.allowed_content_level = kwargs.get('allowed_content_level', None) - self.blocking = kwargs.get('blocking', None) - self.enabled = kwargs.get('enabled', None) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - - -class RaiPolicyProperties(msrest.serialization.Model): - """Azure OpenAI Content Filters properties. - - :ivar base_policy_name: Name of the base Content Filters. - :vartype base_policy_name: str - :ivar completion_blocklists: - :vartype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar content_filters: - :vartype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :ivar mode: Content Filters mode. Possible values include: "Default", "Deferred", "Blocking". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :ivar prompt_blocklists: - :vartype prompt_blocklists: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - - _attribute_map = { - 'base_policy_name': {'key': 'basePolicyName', 'type': 'str'}, - 'completion_blocklists': {'key': 'completionBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'content_filters': {'key': 'contentFilters', 'type': '[RaiPolicyContentFilter]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'prompt_blocklists': {'key': 'promptBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_policy_name: Name of the base Content Filters. - :paramtype base_policy_name: str - :keyword completion_blocklists: - :paramtype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword content_filters: - :paramtype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :keyword mode: Content Filters mode. Possible values include: "Default", "Deferred", - "Blocking". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :keyword prompt_blocklists: - :paramtype prompt_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - super(RaiPolicyProperties, self).__init__(**kwargs) - self.base_policy_name = kwargs.get('base_policy_name', None) - self.completion_blocklists = kwargs.get('completion_blocklists', None) - self.content_filters = kwargs.get('content_filters', None) - self.mode = kwargs.get('mode', None) - self.prompt_blocklists = kwargs.get('prompt_blocklists', None) - self.type = kwargs.get('type', None) - - -class RaiPolicyPropertiesBasicResource(Resource): - """Azure OpenAI Content Filters resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Azure OpenAI Content Filters properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiPolicyProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Azure OpenAI Content Filters properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - super(RaiPolicyPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiPolicyPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """Azure OpenAI Content Filters resource list. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiPolicyPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - super(RaiPolicyPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.managed_resource_group_settings = kwargs.get('managed_resource_group_settings', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.registry_private_endpoint_connections = kwargs.get('registry_private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = kwargs.get('passwords', None) - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(**kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.registry_private_link_service_connection_state = kwargs.get('registry_private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = kwargs.get('capture_headers', None) - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = kwargs.get('target_vm_size', None) - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the rolling data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the rolling data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(**kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_offset = kwargs['window_offset'] - self.window_size = kwargs['window_size'] - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) - self.provisioning_state = None - self.trigger = kwargs['trigger'] - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) - - -class SecretExpiry(msrest.serialization.Model): - """Secret expiration configuration. - - :ivar expirable_secret: Indicates if the secret is expirable. - :vartype expirable_secret: bool - :ivar expire_after_hours: Number of hours after which the secret will expire. - :vartype expire_after_hours: int - """ - - _attribute_map = { - 'expirable_secret': {'key': 'expirableSecret', 'type': 'bool'}, - 'expire_after_hours': {'key': 'expireAfterHours', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expirable_secret: Indicates if the secret is expirable. - :paramtype expirable_secret: bool - :keyword expire_after_hours: Number of hours after which the secret will expire. - :paramtype expire_after_hours: int - """ - super(SecretExpiry, self).__init__(**kwargs) - self.expirable_secret = kwargs.get('expirable_secret', False) - self.expire_after_hours = kwargs.get('expire_after_hours', 1) - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = kwargs.get('serverless_compute_custom_subnet', None) - self.serverless_compute_no_public_ip = kwargs.get('serverless_compute_no_public_ip', None) - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = kwargs['capacity_reservation_group_id'] - self.endpoint_reserved_capacity = kwargs.get('endpoint_reserved_capacity', None) - - -class ServerlessEndpointContentSafety(msrest.serialization.Model): - """ServerlessEndpointContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_status: Required. Specifies the status of content safety. Possible values - include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content_safety_status: Required. Specifies the status of content safety. Possible - values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ServerlessEndpointContentSafety, self).__init__(**kwargs) - self.content_safety_status = kwargs['content_safety_status'] - - -class ServerlessEndpointInferenceEndpoint(msrest.serialization.Model): - """ServerlessEndpointInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Dictionary of :code:``. - :vartype headers: dict[str, str] - :ivar uri: Required. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Required. - :paramtype uri: str - """ - super(ServerlessEndpointInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = kwargs['uri'] - - -class ServerlessEndpointModelSettings(msrest.serialization.Model): - """ServerlessEndpointModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. - :paramtype model_id: str - """ - super(ServerlessEndpointModelSettings, self).__init__(**kwargs) - self.model_id = kwargs['model_id'] - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :vartype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :ivar endpoint_state: The current state of the ServerlessEndpoint. Possible values include: - "Unknown", "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", - "CreationFailed", "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription Azure ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_state': {'readonly': True}, - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :paramtype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.content_safety = kwargs.get('content_safety', None) - self.endpoint_state = None - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = kwargs.get('model_settings', None) - self.provisioning_state = None - - -class ServerlessEndpointResourceProperties(EndpointResourceProperties): - """ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Possible values include: "Key". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar content_safety: - :vartype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :ivar marketplace_subscription_id: - :vartype marketplace_subscription_id: str - :ivar metadata: Anything. - :vartype metadata: any - :ivar model_settings: - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :ivar offer: - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ServerlessEndpointContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessEndpointInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ServerlessEndpointModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Possible values include: "Key". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword content_safety: - :paramtype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :keyword endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :paramtype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :keyword inference_endpoint: - :paramtype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :keyword marketplace_subscription_id: - :paramtype marketplace_subscription_id: str - :keyword metadata: Anything. - :paramtype metadata: any - :keyword model_settings: - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :keyword offer: - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'serverlessEndpoint' # type: str - self.auth_mode = kwargs.get('auth_mode', None) - self.capacity_reservation = kwargs.get('capacity_reservation', None) - self.content_safety = kwargs.get('content_safety', None) - self.endpoint_state = kwargs.get('endpoint_state', None) - self.inference_endpoint = kwargs.get('inference_endpoint', None) - self.marketplace_subscription_id = kwargs.get('marketplace_subscription_id', None) - self.metadata = kwargs.get('metadata', None) - self.model_settings = kwargs.get('model_settings', None) - self.offer = kwargs.get('offer', None) - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = kwargs['uri'] - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. - :vartype offer_name: str - :ivar publisher: Required. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer_name: Required. - :paramtype offer_name: str - :keyword publisher: Required. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = kwargs['offer_name'] - self.publisher = kwargs['publisher'] - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :paramtype address_prefixes: list[str] - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.address_prefixes = kwargs.get('address_prefixes', None) - self.port_ranges = kwargs.get('port_ranges', None) - self.protocol = kwargs.get('protocol', None) - self.service_tag = kwargs.get('service_tag', None) - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.group_id = kwargs.get('group_id', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.resource_type = None - self.sku = kwargs.get('sku', None) - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] arm-id of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] arm-id of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.Speech' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(SpeechEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(**kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_end = kwargs['window_end'] - self.window_start = kwargs['window_start'] - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_trials = kwargs.get('max_trials', 1000) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = kwargs.get('top', 10) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = kwargs.get('limit', None) - self.unit = None - self.status = kwargs.get('status', None) - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment for - the workspace MSI on resource group level. - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_service_side_cmk_encryption: - :vartype enable_service_side_cmk_encryption: bool - :ivar enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :vartype enable_simplified_cmk: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_service_side_cmk_encryption': {'key': 'properties.enableServiceSideCMKEncryption', 'type': 'bool'}, - 'enable_simplified_cmk': {'key': 'properties.enableSimplifiedCmk', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment - for the workspace MSI on resource group level. - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_service_side_cmk_encryption: - :paramtype enable_service_side_cmk_encryption: bool - :keyword enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :paramtype enable_simplified_cmk: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', None) - self.allow_role_assignment_on_rg = kwargs.get('allow_role_assignment_on_rg', None) - self.application_insights = kwargs.get('application_insights', None) - self.associated_workspaces = kwargs.get('associated_workspaces', None) - self.container_registries = kwargs.get('container_registries', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_service_side_cmk_encryption = kwargs.get('enable_service_side_cmk_encryption', None) - self.enable_simplified_cmk = kwargs.get('enable_simplified_cmk', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.existing_workspaces = kwargs.get('existing_workspaces', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.hbi_workspace = kwargs.get('hbi_workspace', None) - self.hub_resource_id = kwargs.get('hub_resource_id', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.key_vault = kwargs.get('key_vault', None) - self.key_vaults = kwargs.get('key_vaults', None) - self.managed_network = kwargs.get('managed_network', None) - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.service_provisioned_resource_group = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.storage_account = kwargs.get('storage_account', None) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.storage_hns_enabled = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.tenant_id = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) - self.workspace_hub_config = kwargs.get('workspace_hub_config', None) - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) - - -class WorkspaceConnectionAccountKey(msrest.serialization.Model): - """Account key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionAccountKey, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = kwargs.get('auth_url', None) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.developer_token = kwargs.get('developer_token', None) - self.password = kwargs.get('password', None) - self.refresh_token = kwargs.get('refresh_token', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.username = kwargs.get('username', None) - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = kwargs.get('password', None) - self.security_token = kwargs.get('security_token', None) - self.username = kwargs.get('username', None) - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = kwargs.get('additional_workspace_storage_accounts', None) - self.default_workspace_resource_group = kwargs.get('default_workspace_resource_group', None) - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar allow_role_assignment_on_rg: - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword allow_role_assignment_on_rg: - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.allow_role_assignment_on_rg = kwargs.get('allow_role_assignment_on_rg', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.managed_network = kwargs.get('managed_network', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py deleted file mode 100644 index fa9ed84e1e80..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py +++ /dev/null @@ -1,33995 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = category - self.created_by_workspace_arm_id = None - self.error = error - self.expiry_time = expiry_time - self.group = None - self.is_shared_to_all = is_shared_to_all - self.metadata = metadata - self.pe_requirement = pe_requirement - self.pe_status = pe_status - self.shared_user_list = shared_user_list - self.target = target - self.use_workspace_managed_identity = use_workspace_managed_identity - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = credentials - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - *, - key1: Optional[str] = None, - key2: Optional[str] = None, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Account key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccountKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionAccountKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Account key object for workspace connection credential. - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = credentials - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - *, - system_created_acr_account: Optional["SystemCreatedAcrAccount"] = None, - user_created_acr_account: Optional["UserCreatedAcrAccount"] = None, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = system_created_acr_account - self.user_created_acr_account = user_created_acr_account - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = properties - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'AKS' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = subnet_id - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.docker_bridge_cidr = docker_bridge_cidr - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", - ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", - load_balancer_subnet: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = cluster_fqdn - self.system_services = None - self.agent_count = agent_count - self.agent_vm_size = agent_vm_size - self.cluster_purpose = cluster_purpose - self.ssl_configuration = ssl_configuration - self.aks_networking_configuration = aks_networking_configuration - self.load_balancer_type = load_balancer_type - self.load_balancer_subnet = load_balancer_subnet - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = properties - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'AmlCompute' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - *, - os_type: Optional[Union[str, "OsType"]] = "Linux", - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "VmPriority"]] = None, - virtual_machine_image: Optional["VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["ScaleSettings"] = None, - user_account_credentials: Optional["UserAccountCredentials"] = None, - subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", - enable_node_public_ip: Optional[bool] = True, - property_bag: Optional[Any] = None, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = os_type - self.vm_size = vm_size - self.vm_priority = vm_priority - self.virtual_machine_image = virtual_machine_image - self.isolated_network = isolated_network - self.scale_settings = scale_settings - self.user_account_credentials = user_account_credentials - self.subnet = subnet - self.remote_login_port_public_access = remote_login_port_public_access - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = enable_node_public_ip - self.property_bag = property_bag - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = id - self.display_name = display_name - self.description = description - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionApiKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = credentials - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = resource_id - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = object_id - self.tenant_id = tenant_id - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.component_id = component_id - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.identity = identity - self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = notification_setting - self.services = services - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - *, - task_details: "AutoMLVertical", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - services: Optional[Dict[str, "JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, services=services, **kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = environment_id - self.environment_variables = environment_variables - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.task_details = task_details - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.task_type = None # type: Optional[str] - self.training_data = training_data - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = delay_in_minutes - self.enabled = enabled - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = min_node_count - self.enabled = enabled - self.max_node_count = max_node_count - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str - self.account_name = account_name - self.container_name = container_name - self.endpoint = endpoint - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = account_name - self.endpoint = endpoint - self.filesystem = filesystem - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = event_type - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(event_type=event_type, **kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str - self.account_name = account_name - self.endpoint = endpoint - self.file_share_name = file_share_name - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.properties = properties - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - deployment_configuration: Optional["BatchDeploymentConfiguration"] = None, - error_threshold: Optional[int] = -1, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = 1, - mini_batch_size: Optional[int] = 10, - model: Optional["AssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = "predictions.csv", - resources: Optional["DeploymentResourceConfiguration"] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.compute = compute - self.deployment_configuration = deployment_configuration - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.provisioning_state = None - self.resources = resources - self.retry_settings = retry_settings - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = deployment_name - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.description = description - self.keys = keys - self.properties = properties - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.defaults = defaults - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - component_id: Optional["IdAssetReference"] = None, - description: Optional[str] = None, - settings: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = component_id - self.description = description - self.settings = settings - self.tags = tags - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = 3, - timeout: Optional[datetime.timedelta] = "PT30S", - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - *, - propagation: Optional[str] = None, - create_host_path: Optional[bool] = None, - selinux: Optional[str] = None, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = propagation - self.create_host_path = create_host_path - self.selinux = selinux - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["PendingUploadCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - *, - minimum: Optional[int] = None, - maximum: Optional[int] = None, - step: Optional[int] = None, - default: Optional[int] = None, - allowed_values: Optional[List[int]] = None, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = minimum - self.maximum = maximum - self.step = step - self.default = default - self.allowed_values = allowed_values - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - training_settings: Optional["ClassificationTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = enable_dnn_training - self.enable_model_explainability = enable_model_explainability - self.enable_onnx_compatible_models = enable_onnx_compatible_models - self.enable_stack_ensemble = enable_stack_ensemble - self.enable_vote_ensemble = enable_vote_ensemble - self.ensemble_model_download_timeout = ensemble_model_download_timeout - self.stack_ensemble_settings = stack_ensemble_settings - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - *, - properties: Optional["ScaleSettingsInformation"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = properties - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.version_upgrade_option = version_upgrade_option - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[str] = None, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "DataCollectionMode"]] = None, - data_id: Optional[str] = None, - sampling_rate: Optional[float] = 1, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = client_id - self.data_collection_mode = data_collection_mode - self.data_id = data_id - self.sampling_rate = sampling_rate - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - *, - fields: Optional[List[str]] = None, - parameters: Optional[Any] = None, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = fields - self.parameters = parameters - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - services: Optional[Dict[str, "JobService"]] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.queue_settings = queue_settings - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - self.provisioning_state = None - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = display_name - self.endpoint_uri = endpoint_uri - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - autosave: Optional[Union[str, "Autosave"]] = None, - gpu: Optional[str] = None, - network: Optional[Union[str, "Network"]] = None, - environment: Optional["ComputeInstanceEnvironmentInfo"] = None, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = name - self.autosave = autosave - self.gpu = gpu - self.network = network - self.environment = environment - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - caching: Optional[Union[str, "Caching"]] = None, - disk_size_gb: Optional[int] = None, - lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = caching - self.disk_size_gb = disk_size_gb - self.lun = lun - self.storage_account_type = storage_account_type - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - *, - source: Optional[str] = None, - source_type: Optional[Union[str, "SourceType"]] = None, - mount_name: Optional[str] = None, - mount_action: Optional[Union[str, "MountAction"]] = None, - mount_mode: Optional[Union[str, "MountMode"]] = None, - created_by: Optional[str] = None, - mount_path: Optional[str] = None, - mount_state: Optional[Union[str, "MountState"]] = None, - mounted_on: Optional[datetime.datetime] = None, - error: Optional[str] = None, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = source - self.source_type = source_type - self.mount_name = mount_name - self.mount_action = mount_action - self.mount_mode = mount_mode - self.created_by = created_by - self.mount_path = mount_path - self.mount_state = mount_state - self.mounted_on = mounted_on - self.error = error - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = name - self.version = version - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_name: Optional[Union[str, "OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "OperationStatus"]] = None, - operation_trigger: Optional[Union[str, "OperationTrigger"]] = None, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = operation_name - self.operation_time = operation_time - self.operation_status = operation_status - self.operation_trigger = operation_trigger - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, - ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - enable_os_patching: Optional[bool] = False, - enable_root_access: Optional[bool] = True, - enable_sso: Optional[bool] = True, - release_quota_on_stop: Optional[bool] = False, - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - schedules: Optional["ComputeSchedules"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = vm_size - self.subnet = subnet - self.application_sharing_policy = application_sharing_policy - self.autologger_settings = autologger_settings - self.ssh_settings = ssh_settings - self.custom_services = custom_services - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.enable_os_patching = enable_os_patching - self.enable_root_access = enable_root_access - self.enable_sso = enable_sso - self.release_quota_on_stop = release_quota_on_stop - self.personal_compute_instance_settings = personal_compute_instance_settings - self.setup_scripts = setup_scripts - self.last_operation = None - self.schedules = schedules - self.idle_time_before_shutdown = idle_time_before_shutdown - self.enable_node_public_ip = enable_node_public_ip - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", - admin_public_key: Optional[str] = None, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = ssh_public_access - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = admin_public_key - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = runtime - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "ComputeWeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(properties=properties, **kwargs) - self.properties = properties - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = spark_runtime_version - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - *, - compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = compute_start_stop - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ScheduleStatus"]] = None, - action: Optional[Union[str, "ComputePowerAction"]] = None, - trigger_type: Optional[Union[str, "ComputeTriggerType"]] = None, - recurrence: Optional["Recurrence"] = None, - cron: Optional["Cron"] = None, - schedule: Optional["ScheduleBase"] = None, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = status - self.action = action - self.trigger_type = trigger_type - self.recurrence = recurrence - self.cron = cron - self.schedule = schedule - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = container_resource_limits - self.container_resource_requests = container_resource_requests - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = cpu - self.gpu = gpu - self.memory = memory - - -class ContentSafety(msrest.serialization.Model): - """ContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - content_safety_status: Union[str, "ContentSafetyStatus"], - **kwargs - ): - """ - :keyword content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ContentSafety, self).__init__(**kwargs) - self.content_safety_status = content_safety_status - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = failure_reason - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties, ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties', 'serverlessEndpoint': 'ServerlessEndpointResourceProperties'} - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = associated_resource_id - self.deployments = deployments - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = endpoint_uri - self.failure_reason = failure_reason - self.location = location - self.name = name - self.provisioning_state = None - self.should_create_ai_services_endpoint = should_create_ai_services_endpoint - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = collections_throughput - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - *, - monitor_definition: "MonitorDefinition", - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = monitor_definition - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - expression: Optional[str] = None, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = start_time - self.time_zone = time_zone - self.expression = expression - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - *, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = end_time - self.start_time = start_time - self.time_zone = time_zone - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - expression: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = expression - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - *, - keys: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = keys - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["CustomKeys"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = credentials - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: str, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'custom_model' # type: str - self.description = description - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'custom_model' # type: str - self.description = description - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - *, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = notification_types - self.properties = properties - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] Reference to the component asset used to calculate the - custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - } - - def __init__( - self, - *, - component_id: str, - metric_thresholds: List["CustomMetricThreshold"], - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - input_assets: Optional[Dict[str, "MonitoringInputDataBase"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] Reference to the component asset used to calculate - the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - super(CustomMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = component_id - self.input_assets = input_assets - self.inputs = inputs - self.metric_thresholds = metric_thresholds - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - name: Optional[str] = None, - image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, - docker: Optional["Docker"] = None, - endpoints: Optional[List["Endpoint"]] = None, - volumes: Optional[List["VolumeDefinition"]] = None, - kernel: Optional["JupyterKernelConfig"] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.name = name - self.image = image - self.environment_variables = environment_variables - self.docker = docker - self.endpoints = endpoints - self.volumes = volumes - self.kernel = kernel - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - *, - values: List[int], - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = values - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = properties - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'Databricks' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) - self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - self.workspace_url = workspace_url - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - *, - collections: Dict[str, "Collection"], - request_logging: Optional["RequestLogging"] = None, - rolling_rate: Optional[Union[str, "RollingRateType"]] = None, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = collections - self.request_logging = request_logging - self.rolling_rate = rolling_rate - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = properties - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = data_lake_store_account_name - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataQualityMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = properties - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Datastore"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = data_uri - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = content - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - *, - container_type: Optional[Union[str, "ContainerType"]] = None, - tail: Optional[int] = None, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = container_type - self.tail = tail - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.properties = properties - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - *, - destination_name: Optional[str] = None, - destination_version: Optional[str] = None, - registry_name: Optional[str] = None, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = destination_name - self.destination_version = destination_version - self.registry_name = registry_name - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - *, - application_insights: Optional[Dict[str, Any]] = None, - container_registry: Optional[Dict[str, Any]] = None, - dns_resolution: Optional[Dict[str, Any]] = None, - key_vault: Optional[Dict[str, Any]] = None, - nsg: Optional[Dict[str, Any]] = None, - others: Optional[Dict[str, Any]] = None, - required_resource_providers: Optional[Dict[str, Any]] = None, - resource_lock: Optional[Dict[str, Any]] = None, - storage_account: Optional[Dict[str, Any]] = None, - udr: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = application_insights - self.container_registry = container_registry - self.dns_resolution = dns_resolution - self.key_vault = key_vault - self.nsg = nsg - self.others = others - self.required_resource_providers = required_resource_providers - self.resource_lock = resource_lock - self.storage_account = storage_account - self.udr = udr - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseResponseResultValue"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = value - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - *, - user_defined_route_results: Optional[List["DiagnoseResult"]] = None, - network_security_rule_results: Optional[List["DiagnoseResult"]] = None, - resource_lock_results: Optional[List["DiagnoseResult"]] = None, - dns_resolution_results: Optional[List["DiagnoseResult"]] = None, - storage_account_results: Optional[List["DiagnoseResult"]] = None, - key_vault_results: Optional[List["DiagnoseResult"]] = None, - container_registry_results: Optional[List["DiagnoseResult"]] = None, - application_insights_results: Optional[List["DiagnoseResult"]] = None, - other_results: Optional[List["DiagnoseResult"]] = None, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = user_defined_route_results - self.network_security_rule_results = network_security_rule_results - self.resource_lock_results = resource_lock_results - self.dns_resolution_results = dns_resolution_results - self.storage_account_results = storage_account_results - self.key_vault_results = key_vault_results - self.container_registry_results = container_registry_results - self.application_insights_results = application_insights_results - self.other_results = other_results - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = value - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - privileged: Optional[bool] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.privileged = privileged - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - user_name: Optional[str] = None, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = password - self.user_name = user_name - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_vault_properties: "KeyVaultProperties", - status: Union[str, "EncryptionStatus"], - cosmos_db_resource_id: Optional[str] = None, - identity: Optional["IdentityForCmk"] = None, - search_account_resource_id: Optional[str] = None, - storage_account_resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = cosmos_db_resource_id - self.identity = identity - self.key_vault_properties = key_vault_properties - self.search_account_resource_id = search_account_resource_id - self.status = status - self.storage_account_resource_id = storage_account_resource_id - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - *, - key_vault_properties: "EncryptionKeyVaultUpdateProperties", - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = key_vault_properties - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - *, - protocol: Optional[Union[str, "Protocol"]] = "tcp", - name: Optional[str] = None, - target: Optional[int] = None, - published: Optional[int] = None, - host_ip: Optional[str] = None, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = protocol - self.name = name - self.target = target - self.published = published - self.host_ip = host_ip - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = primary_key - self.secondary_key = secondary_key - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = 0, - refresh_after_time_utc: Optional[int] = 0, - token_type: Optional[str] = None, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = access_token - self.expiry_time_utc = expiry_time_utc - self.refresh_after_time_utc = refresh_after_time_utc - self.token_type = token_type - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - source: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = format - self.name = name - self.source = source - self.version = version - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointDeploymentResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - *, - keys: Optional["AccountApiKeys"] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = keys - - -class EndpointModelDeprecationProperties(msrest.serialization.Model): - """EndpointModelDeprecationProperties. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: ~datetime.datetime - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: ~datetime.datetime - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'iso-8601'}, - 'inference': {'key': 'inference', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - fine_tune: Optional[datetime.datetime] = None, - inference: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: ~datetime.datetime - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: ~datetime.datetime - """ - super(EndpointModelDeprecationProperties, self).__init__(**kwargs) - self.fine_tune = fine_tune - self.inference = inference - - -class EndpointModelProperties(msrest.serialization.Model): - """Endpoint Model properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar deprecation: - :vartype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar format: Deployment model format. - :vartype format: str - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar name: Deployment model name. - :vartype name: str - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'EndpointModelDeprecationProperties'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'format': {'key': 'format', 'type': 'str'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'skus': {'key': 'skus', 'type': '[EndpointModelSkuProperties]'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - capabilities: Optional[Dict[str, str]] = None, - deprecation: Optional["EndpointModelDeprecationProperties"] = None, - finetune_capabilities: Optional[Dict[str, str]] = None, - format: Optional[str] = None, - is_default_version: Optional[bool] = None, - lifecycle_status: Optional[Union[str, "ModelLifecycleStatus"]] = None, - max_capacity: Optional[int] = None, - name: Optional[str] = None, - skus: Optional[List["EndpointModelSkuProperties"]] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword deprecation: - :paramtype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword format: Deployment model format. - :paramtype format: str - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword name: Deployment model name. - :paramtype name: str - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - """ - super(EndpointModelProperties, self).__init__(**kwargs) - self.capabilities = capabilities - self.deprecation = deprecation - self.finetune_capabilities = finetune_capabilities - self.format = format - self.is_default_version = is_default_version - self.lifecycle_status = lifecycle_status - self.max_capacity = max_capacity - self.name = name - self.skus = skus - self.system_data = None - self.version = version - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointModelProperties]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointModelProperties"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointModelSkuCapacityProperties(msrest.serialization.Model): - """EndpointModelSkuCapacityProperties. - - :ivar default: The default capacity. - :vartype default: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - } - - def __init__( - self, - *, - default: Optional[int] = None, - maximum: Optional[int] = None, - **kwargs - ): - """ - :keyword default: The default capacity. - :paramtype default: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - """ - super(EndpointModelSkuCapacityProperties, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - - -class EndpointModelSkuProperties(msrest.serialization.Model): - """EndpointModelSkuProperties. - - :ivar capacity: - :vartype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :ivar connection_ids: The list of ARM id for the connection support this SKU. - :vartype connection_ids: list[str] - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar name: The name of the model SKU. - :vartype name: str - :ivar rate_limits: - :vartype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'EndpointModelSkuCapacityProperties'}, - 'connection_ids': {'key': 'connectionIds', 'type': '[str]'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[EndpointModelSkuRateLimitProperties]'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional["EndpointModelSkuCapacityProperties"] = None, - connection_ids: Optional[List[str]] = None, - deprecation_date: Optional[datetime.datetime] = None, - name: Optional[str] = None, - rate_limits: Optional[List["EndpointModelSkuRateLimitProperties"]] = None, - usage_name: Optional[str] = None, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :keyword connection_ids: The list of ARM id for the connection support this SKU. - :paramtype connection_ids: list[str] - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword rate_limits: - :paramtype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - """ - super(EndpointModelSkuProperties, self).__init__(**kwargs) - self.capacity = capacity - self.connection_ids = connection_ids - self.deprecation_date = deprecation_date - self.name = name - self.rate_limits = rate_limits - self.usage_name = usage_name - - -class EndpointModelSkuRateLimitProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitProperties. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: The call rate limit for the model. - :vartype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[EndpointModelSkuRateLimitRuleProperties]'}, - } - - def __init__( - self, - *, - count: Optional[float] = None, - renewal_period: Optional[float] = None, - rules: Optional[List["EndpointModelSkuRateLimitRuleProperties"]] = None, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: The call rate limit for the model. - :paramtype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - super(EndpointModelSkuRateLimitProperties, self).__init__(**kwargs) - self.count = count - self.renewal_period = renewal_period - self.rules = rules - - -class EndpointModelSkuRateLimitRulePatternProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRulePatternProperties. - - :ivar method: - :vartype method: str - :ivar path: - :vartype path: str - """ - - _attribute_map = { - 'method': {'key': 'method', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - method: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword method: - :paramtype method: str - :keyword path: - :paramtype path: str - """ - super(EndpointModelSkuRateLimitRulePatternProperties, self).__init__(**kwargs) - self.method = method - self.path = path - - -class EndpointModelSkuRateLimitRuleProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRuleProperties. - - :ivar count: - :vartype count: float - :ivar dynamic_throttling_enabled: If the dynamic throttling is enabled. - :vartype dynamic_throttling_enabled: bool - :ivar key: - :vartype key: str - :ivar match_patterns: - :vartype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :ivar min_count: - :vartype min_count: float - :ivar renewal_period: - :vartype renewal_period: float - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'key': {'key': 'key', 'type': 'str'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[EndpointModelSkuRateLimitRulePatternProperties]'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - } - - def __init__( - self, - *, - count: Optional[float] = None, - dynamic_throttling_enabled: Optional[bool] = None, - key: Optional[str] = None, - match_patterns: Optional[List["EndpointModelSkuRateLimitRulePatternProperties"]] = None, - min_count: Optional[float] = None, - renewal_period: Optional[float] = None, - **kwargs - ): - """ - :keyword count: - :paramtype count: float - :keyword dynamic_throttling_enabled: If the dynamic throttling is enabled. - :paramtype dynamic_throttling_enabled: bool - :keyword key: - :paramtype key: str - :keyword match_patterns: - :paramtype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :keyword min_count: - :paramtype min_count: float - :keyword renewal_period: - :paramtype renewal_period: float - """ - super(EndpointModelSkuRateLimitRuleProperties, self).__init__(**kwargs) - self.count = count - self.dynamic_throttling_enabled = dynamic_throttling_enabled - self.key = key - self.match_patterns = match_patterns - self.min_count = min_count - self.renewal_period = renewal_period - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = endpoint_invocation_definition - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "EnvironmentVariableType"]] = "local", - value: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.value = value - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - auto_rebuild: Optional[Union[str, "AutoRebuildSetting"]] = None, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.auto_rebuild = auto_rebuild - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.inference_config = inference_config - self.os_type = os_type - self.provisioning_state = None - self.stage = stage - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "VMPriceOSType"], - vm_tier: Union[str, "VMTier"], - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = retail_price - self.os_type = os_type - self.vm_tier = vm_tier - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - *, - billing_currency: Union[str, "BillingCurrency"], - unit_of_measure: Union[str, "UnitOfMeasure"], - values: List["EstimatedVMPrice"], - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = billing_currency - self.unit_of_measure = unit_of_measure - self.values = values - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - *, - value: Optional[List["FQDNEndpointsPropertyBag"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = value - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - *, - properties: "FeatureProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = properties - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - feature_importance_settings: "FeatureImportanceSettings", - metric_threshold: "FeatureAttributionMetricThreshold", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "FeatureAttributionMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "FeatureImportanceMode"]] = None, - target_column: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = mode - self.target_column = target_column - - -class FeatureProperties(ResourceBase): - """DTO object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - feature_name: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.data_type = data_type - self.feature_name = feature_name - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Feature"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetContainerProperties(AssetContainer): - """DTO object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetSpecification(msrest.serialization.Model): - """DTO object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = path - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - data_availability_status: Optional[List[Union[str, "DataAvailabilityStatus"]]] = None, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = data_availability_status - self.description = description - self.display_name = display_name - self.feature_window = feature_window - self.job_id = job_id - self.properties = properties - self.resource = resource - self.spark_configuration = spark_configuration - self.tags = tags - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - job_ids: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = job_ids - - -class FeaturesetVersionProperties(AssetBase): - """DTO object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - entities: Optional[List[str]] = None, - materialization_settings: Optional["MaterializationSettings"] = None, - specification: Optional["FeaturesetSpecification"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.entities = entities - self.materialization_settings = materialization_settings - self.provisioning_state = None - self.specification = specification - self.stage = stage - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """DTO object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityVersionProperties(AssetBase): - """DTO object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - index_columns: Optional[List["IndexColumn"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.index_columns = index_columns - self.provisioning_state = None - self.stage = stage - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_runtime: Optional["ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = compute_runtime - self.offline_store_connection_name = offline_store_connection_name - self.online_store_connection_name = online_store_connection_name - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - *, - features: List[str], - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = features - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - feature_window_end: Optional[datetime.datetime] = None, - feature_window_start: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = feature_window_end - self.feature_window_start = feature_window_start - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = dataset_language - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = columns - self.data_context = data_context - self.input_data_type = None # type: Optional[str] - self.job_input_type = job_input_type - self.uri = uri - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, - training_settings: Optional["ForecastingTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "FeatureLags"]] = None, - forecast_horizon: Optional["ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, - target_lags: Optional["TargetLags"] = None, - target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[List[str]] = None, - use_stl: Optional[Union[str, "UseStl"]] = None, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = country_or_region_for_holidays - self.cv_step_size = cv_step_size - self.feature_lags = feature_lags - self.forecast_horizon = forecast_horizon - self.frequency = frequency - self.seasonality = seasonality - self.short_series_handling_config = short_series_handling_config - self.target_aggregate_function = target_aggregate_function - self.target_lags = target_lags - self.target_rolling_window_size = target_rolling_window_size - self.time_column_name = time_column_name - self.time_series_id_column_names = time_series_id_column_names - self.use_stl = use_stl - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[List["FQDNEndpointDetail"]] = None, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = port - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[List["FQDNEndpoint"]] = None, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - *, - properties: Optional["FQDNEndpoints"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = category - self.parent_rule_names = None - self.status = status - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'FQDN' # type: str - self.destination = destination - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["DataReferenceCredential"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - blob_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = asset_id - self.blob_uri = blob_uri - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["GetBlobReferenceForConsumptionDto"] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = properties - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'HDInsight' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = idle_time_before_shutdown - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - self.version = version - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - *, - current_image_version: Optional[str] = None, - latest_image_version: Optional[str] = None, - is_latest_os_image_version: Optional[bool] = None, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = current_image_version - self.latest_image_version = latest_image_version - self.is_latest_os_image_version = is_latest_os_image_version - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = advanced_settings - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.checkpoint_frequency = checkpoint_frequency - self.checkpoint_model = checkpoint_model - self.checkpoint_run_id = checkpoint_run_id - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class IndexColumn(msrest.serialization.Model): - """DTO object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - column_name: Optional[str] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = column_name - self.data_type = data_type - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - *, - node_selector: Optional[Dict[str, str]] = None, - resources: Optional["InstanceTypeSchemaResources"] = None, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = node_selector - self.resources = resources - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - *, - requests: Optional[Dict[str, str]] = None, - limits: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = requests - self.limits = limits - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = properties - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["JobBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - docker_args: Optional[str] = None, - shm_size: Optional[str] = "2g", - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) - self.docker_args = docker_args - self.shm_size = shm_size - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = job_definition - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - nodes: Optional["Nodes"] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.nodes = nodes - self.port = port - self.properties = properties - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - argv: Optional[List[str]] = None, - display_name: Optional[str] = None, - language: Optional[str] = None, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = argv - self.display_name = display_name - self.language = language - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - key_vault_arm_id: str, - identity_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = identity_client_id - self.key_identifier = key_identifier - self.key_vault_arm_id = key_vault_arm_id - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = properties - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'Kubernetes' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.app_insights_enabled = app_insights_enabled - self.data_collector = data_collector - self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = instance_type - self.liveness_probe = liveness_probe - self.model = model - self.model_mount_path = model_mount_path - self.provisioning_state = None - self.readiness_probe = readiness_probe - self.request_settings = request_settings - self.scale_settings = scale_settings - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = container_resource_requirements - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = "default", - default_instance_type: Optional[str] = None, - instance_types: Optional[Dict[str, "InstanceTypeSchema"]] = None, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = relay_connection_string - self.service_bus_connection_string = service_bus_connection_string - self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train - self.vc_name = vc_name - self.namespace = namespace - self.default_instance_type = default_instance_type - self.instance_types = instance_types - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = artifact_name - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(artifact_name=artifact_name, **kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - *, - container_registry_credentials: Optional["RegistryListCredentialsResult"] = None, - notebook_access_keys: Optional["ListNotebookKeysResult"] = None, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = container_registry_credentials - self.notebook_access_keys = notebook_access_keys - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str - self.value = value - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: The identity which will be leveraged by the monitoring jobs. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword identity: The identity which will be leveraged by the monitoring jobs. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = identity - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - managed_identity_type: Optional[str] = None, - user_managed_identity_client_id: Optional[str] = None, - user_managed_identity_principal_id: Optional[str] = None, - user_managed_identity_resource_id: Optional[str] = None, - user_managed_identity_tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = managed_identity_type - self.user_managed_identity_client_id = user_managed_identity_client_id - self.user_managed_identity_principal_id = user_managed_identity_principal_id - self.user_managed_identity_resource_id = user_managed_identity_resource_id - self.user_managed_identity_tenant_id = user_managed_identity_tenant_id - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = include_spark - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_ready: Optional[bool] = None, - status: Optional[Union[str, "ManagedNetworkStatus"]] = None, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = spark_ready - self.status = status - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - *, - isolation_mode: Optional[Union[str, "IsolationMode"]] = None, - outbound_rules: Optional[Dict[str, "OutboundRule"]] = None, - status: Optional["ManagedNetworkProvisionStatus"] = None, - **kwargs - ): - """ - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = isolation_mode - self.network_id = None - self.outbound_rules = outbound_rules - self.status = status - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - :ivar endpoint_compute_type: Enum to determine endpoint compute type. Possible values include: - "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar model: - :vartype model: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - endpoint_compute_type: Optional[Union[str, "EndpointComputeType"]] = None, - model: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword endpoint_compute_type: Enum to determine endpoint compute type. Possible values - include: "Managed", "Kubernetes", "AzureMLCompute". - :paramtype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :keyword model: - :paramtype model: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, **kwargs) - self.type = 'managedOnlineEndpoint' # type: str - self.endpoint_compute_type = endpoint_compute_type - self.model = model - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar compute: - :vartype compute: str - :ivar description: - :vartype description: str - :ivar mirror_traffic: Dictionary of :code:``. - :vartype mirror_traffic: dict[str, int] - :ivar scoring_uri: - :vartype scoring_uri: str - :ivar traffic: Dictionary of :code:``. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - auth_mode: Optional[Union[str, "EndpointAuthMode"]] = None, - compute: Optional[str] = None, - description: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - scoring_uri: Optional[str] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword compute: - :paramtype compute: str - :keyword description: - :paramtype description: str - :keyword mirror_traffic: Dictionary of :code:``. - :paramtype mirror_traffic: dict[str, int] - :keyword scoring_uri: - :paramtype scoring_uri: str - :keyword traffic: Dictionary of :code:``. - :paramtype traffic: dict[str, int] - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - self.auth_mode = auth_mode - self.compute = compute - self.description = description - self.mirror_traffic = mirror_traffic - self.scoring_uri = scoring_uri - self.traffic = traffic - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = None - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - *, - assigned_identities: Optional[List["ManagedResourceGroupAssignedIdentities"]] = None, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = assigned_identities - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The identifying name of the Offer of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The identifying name of the Plan of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The identifying name of the Publisher of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - *, - properties: "MarketplaceSubscriptionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = properties - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = model_id - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["MarketplaceSubscription"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MaterializationComputeResource(msrest.serialization.Model): - """DTO object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = instance_type - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - *, - notification: Optional["NotificationSetting"] = None, - resource: Optional["MaterializationComputeResource"] = None, - schedule: Optional["RecurrenceTrigger"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - store_type: Optional[Union[str, "MaterializationStoreType"]] = None, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = notification - self.resource = resource - self.schedule = schedule - self.spark_configuration = spark_configuration - self.store_type = store_type - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mlflow_model' # type: str - self.description = description - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'mlflow_model' # type: str - self.description = description - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = referenced_uris - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mltable' # type: str - self.description = description - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - :ivar model_id: The unique model identifier that this ServerlessEndpoint should provision. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword model_id: The unique model identifier that this ServerlessEndpoint should provision. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = model_id - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - self.provisioning_state = None - self.stage = stage - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The entities targeted by the monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - *, - compute_configuration: "MonitorComputeConfigurationBase", - signals: Dict[str, "MonitoringSignalBase"], - alert_notification_settings: Optional["MonitorNotificationSettings"] = None, - monitoring_target: Optional["MonitoringTarget"] = None, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The entities targeted by the monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = alert_notification_settings - self.compute_configuration = compute_configuration - self.monitoring_target = monitoring_target - self.signals = signals - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: The email recipient list which has a limitation of 499 characters in total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - *, - emails: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword emails: The email recipient list which has a limitation of 499 characters in total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = emails - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: Reference to the deployment asset targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: Reference to the model asset targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - *, - task_type: Union[str, "ModelTaskType"], - deployment_id: Optional[str] = None, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_id: Reference to the deployment asset targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: Reference to the model asset targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = deployment_id - self.model_id = model_id - self.task_type = task_type - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - *, - value: Optional[float] = None, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = value - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - *, - email_notification_settings: Optional["MonitorEmailNotificationSettings"] = None, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = email_notification_settings - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_identity: "MonitorComputeIdentityBase", - instance_type: str, - runtime_version: str, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = compute_identity - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = error_message - self.status_code = status_code - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - is_private_link_enabled: Optional[bool] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = fqdn - self.is_private_link_enabled = is_private_link_enabled - self.notebook_preparation_error = notebook_preparation_error - self.resource_id = resource_id - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, - emails: Optional[List[str]] = None, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = email_on - self.emails = emails - self.webhooks = webhooks - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionOAuth2"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = credentials - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - artifact: "OneLakeArtifact", - one_lake_workspace_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = artifact - self.endpoint = endpoint - self.one_lake_workspace_name = one_lake_workspace_name - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for - Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' - for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' - does. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.compute = compute - self.mirror_traffic = mirror_traffic - self.provisioning_state = None - self.public_network_access = public_network_access - self.traffic = traffic - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - max_queue_wait: Optional[datetime.timedelta] = "PT0.5S", - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.max_queue_wait = max_queue_wait - self.request_timeout = request_timeout - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(OpenAIEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - :ivar os_patching_errors: Collection of errors encountered when doing os patching. - :vartype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - 'os_patching_errors': {'key': 'osPatchingErrors', 'type': '[ErrorResponse]'}, - } - - def __init__( - self, - *, - patch_status: Optional[Union[str, "PatchStatus"]] = None, - latest_patch_time: Optional[str] = None, - reboot_pending: Optional[bool] = None, - scheduled_reboot_time: Optional[str] = None, - os_patching_errors: Optional[List["ErrorResponse"]] = None, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - :keyword os_patching_errors: Collection of errors encountered when doing os patching. - :paramtype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = patch_status - self.latest_patch_time = latest_patch_time - self.reboot_pending = reboot_pending - self.scheduled_reboot_time = scheduled_reboot_time - self.os_patching_errors = os_patching_errors - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OutboundRuleBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ComputeResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = description - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - properties: Optional["PartialBatchDeployment"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = tags - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) - self.sku = sku - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - self.sku = sku - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["RegistryPartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = assigned_user - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - services: Optional[Dict[str, "JobService"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jobs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - source_job_id: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = inputs - self.jobs = jobs - self.outputs = outputs - self.settings = settings - self.source_job_id = source_job_id - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["PredictionDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - private_endpoint: Optional["WorkspacePrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[Union[str, "PrivateEndpointConnectionProvisioningState"]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateEndpointConnection"]] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "RuleStatus"]] = None, - subresource_target: Optional[str] = None, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = service_resource_id - self.spark_enabled = spark_enabled - self.spark_status = spark_status - self.subresource_target = subresource_target - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :ivar fqdns: - :vartype fqdns: list[str] - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - 'fqdns': {'key': 'fqdns', 'type': '[str]'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - fqdns: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :keyword fqdns: - :paramtype fqdns: list[str] - """ - super(PrivateEndpointOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - self.fqdns = fqdns - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = subnet_arm_id - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - group_id: Optional[str] = None, - required_members: Optional[List[str]] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.group_id = group_id - self.required_members = required_members - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - failure_threshold: Optional[int] = 30, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = "PT10S", - success_threshold: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "PT2S", - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = failure_threshold - self.initial_delay = initial_delay - self.period = period - self.success_threshold = success_threshold - self.timeout = timeout - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - } - - def __init__( - self, - *, - job_tier: Optional[Union[str, "JobTier"]] = None, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "QuotaUnit"]] = None, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = id - self.type = type - self.limit = limit - self.unit = unit - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["QuotaBaseProperties"]] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = value - self.location = location - - -class RaiBlocklistConfig(msrest.serialization.Model): - """Azure OpenAI blocklist config. - - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - """ - - _attribute_map = { - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'blocklist_name': {'key': 'blocklistName', 'type': 'str'}, - } - - def __init__( - self, - *, - blocking: Optional[bool] = None, - blocklist_name: Optional[str] = None, - **kwargs - ): - """ - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword blocklist_name: Name of ContentFilter. - :paramtype blocklist_name: str - """ - super(RaiBlocklistConfig, self).__init__(**kwargs) - self.blocking = blocking - self.blocklist_name = blocklist_name - - -class RaiBlocklistItemBulkRequest(msrest.serialization.Model): - """The Cognitive Services RaiBlocklist Item request body. - - :ivar name: - :vartype name: str - :ivar properties: Properties of Cognitive Services RaiBlocklist Item. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - properties: Optional["RaiBlocklistItemProperties"] = None, - **kwargs - ): - """ - :keyword name: - :paramtype name: str - :keyword properties: Properties of Cognitive Services RaiBlocklist Item. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemBulkRequest, self).__init__(**kwargs) - self.name = name - self.properties = properties - - -class RaiBlocklistItemProperties(msrest.serialization.Model): - """RAI Custom Blocklist Item properties. - - :ivar is_regex: If the pattern is a regex pattern. - :vartype is_regex: bool - :ivar pattern: Pattern to match against. - :vartype pattern: str - """ - - _attribute_map = { - 'is_regex': {'key': 'isRegex', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__( - self, - *, - is_regex: Optional[bool] = None, - pattern: Optional[str] = None, - **kwargs - ): - """ - :keyword is_regex: If the pattern is a regex pattern. - :paramtype is_regex: bool - :keyword pattern: Pattern to match against. - :paramtype pattern: str - """ - super(RaiBlocklistItemProperties, self).__init__(**kwargs) - self.is_regex = is_regex - self.pattern = pattern - - -class RaiBlocklistItemPropertiesBasicResource(Resource): - """RaiBlocklistItemPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist Item properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - *, - properties: "RaiBlocklistItemProperties", - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist Item properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistItemPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiBlocklistItemPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - super(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RaiBlocklistProperties(msrest.serialization.Model): - """RAI Custom Blocklist properties. - - :ivar description: Description of the block list. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the block list. - :paramtype description: str - """ - super(RaiBlocklistProperties, self).__init__(**kwargs) - self.description = description - - -class RaiBlocklistPropertiesBasicResource(Resource): - """RaiBlocklistPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistProperties'}, - } - - def __init__( - self, - *, - properties: "RaiBlocklistProperties", - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - super(RaiBlocklistPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiBlocklistPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiBlocklistPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - super(RaiBlocklistPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RaiPolicyContentFilter(msrest.serialization.Model): - """Azure OpenAI Content Filter. - - :ivar allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :vartype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar enabled: If the ContentFilter is enabled. - :vartype enabled: bool - :ivar name: Name of ContentFilter. - :vartype name: str - :ivar source: Content source to apply the Content Filters. Possible values include: "Prompt", - "Completion". - :vartype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - - _attribute_map = { - 'allowed_content_level': {'key': 'allowedContentLevel', 'type': 'str'}, - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - *, - allowed_content_level: Optional[Union[str, "AllowedContentLevel"]] = None, - blocking: Optional[bool] = None, - enabled: Optional[bool] = None, - name: Optional[str] = None, - source: Optional[Union[str, "RaiPolicyContentSource"]] = None, - **kwargs - ): - """ - :keyword allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :paramtype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword enabled: If the ContentFilter is enabled. - :paramtype enabled: bool - :keyword name: Name of ContentFilter. - :paramtype name: str - :keyword source: Content source to apply the Content Filters. Possible values include: - "Prompt", "Completion". - :paramtype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - super(RaiPolicyContentFilter, self).__init__(**kwargs) - self.allowed_content_level = allowed_content_level - self.blocking = blocking - self.enabled = enabled - self.name = name - self.source = source - - -class RaiPolicyProperties(msrest.serialization.Model): - """Azure OpenAI Content Filters properties. - - :ivar base_policy_name: Name of the base Content Filters. - :vartype base_policy_name: str - :ivar completion_blocklists: - :vartype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar content_filters: - :vartype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :ivar mode: Content Filters mode. Possible values include: "Default", "Deferred", "Blocking". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :ivar prompt_blocklists: - :vartype prompt_blocklists: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - - _attribute_map = { - 'base_policy_name': {'key': 'basePolicyName', 'type': 'str'}, - 'completion_blocklists': {'key': 'completionBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'content_filters': {'key': 'contentFilters', 'type': '[RaiPolicyContentFilter]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'prompt_blocklists': {'key': 'promptBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - base_policy_name: Optional[str] = None, - completion_blocklists: Optional[List["RaiBlocklistConfig"]] = None, - content_filters: Optional[List["RaiPolicyContentFilter"]] = None, - mode: Optional[Union[str, "RaiPolicyMode"]] = None, - prompt_blocklists: Optional[List["RaiBlocklistConfig"]] = None, - type: Optional[Union[str, "RaiPolicyType"]] = None, - **kwargs - ): - """ - :keyword base_policy_name: Name of the base Content Filters. - :paramtype base_policy_name: str - :keyword completion_blocklists: - :paramtype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword content_filters: - :paramtype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :keyword mode: Content Filters mode. Possible values include: "Default", "Deferred", - "Blocking". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :keyword prompt_blocklists: - :paramtype prompt_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - super(RaiPolicyProperties, self).__init__(**kwargs) - self.base_policy_name = base_policy_name - self.completion_blocklists = completion_blocklists - self.content_filters = content_filters - self.mode = mode - self.prompt_blocklists = prompt_blocklists - self.type = type - - -class RaiPolicyPropertiesBasicResource(Resource): - """Azure OpenAI Content Filters resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Azure OpenAI Content Filters properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiPolicyProperties'}, - } - - def __init__( - self, - *, - properties: "RaiPolicyProperties", - **kwargs - ): - """ - :keyword properties: Required. Azure OpenAI Content Filters properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - super(RaiPolicyPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiPolicyPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """Azure OpenAI Content Filters resource list. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiPolicyPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiPolicyPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - super(RaiPolicyPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = rule - self.seed = seed - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Optional[Union[str, "ComputeRecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["ComputeRecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = frequency - self.interval = interval - self.start_time = start_time - self.time_zone = time_zone - self.schedule = schedule - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "WeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Union[str, "RecurrenceFrequency"], - interval: int, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = frequency - self.interval = interval - self.schedule = schedule - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - *, - key_type: Union[str, "KeyType"], - key_value: Optional[str] = None, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = key_type - self.key_value = key_value - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - *, - key_name: Optional[Union[str, "ServiceAccountKeyName"]] = None, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = key_name - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - managed_resource_group_settings: Optional["ManagedResourceGroupSettings"] = None, - ml_flow_registry_uri: Optional[str] = None, - registry_private_endpoint_connections: Optional[List["RegistryPrivateEndpointConnection"]] = None, - public_network_access: Optional[str] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.sku = sku - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.managed_resource_group_settings = managed_resource_group_settings - self.ml_flow_registry_uri = ml_flow_registry_uri - self.registry_private_endpoint_connections = registry_private_endpoint_connections - self.public_network_access = public_network_access - self.region_details = region_details - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = passwords - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - group_ids: Optional[List[str]] = None, - private_endpoint: Optional["PrivateEndpointResource"] = None, - registry_private_link_service_connection_state: Optional["RegistryPrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = id - self.location = location - self.group_ids = group_ids - self.private_endpoint = private_endpoint - self.registry_private_link_service_connection_state = registry_private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - *, - acr_details: Optional[List["AcrDetails"]] = None, - location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = acr_details - self.location = location - self.storage_account_details = storage_account_details - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Registry"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, - training_settings: Optional["RegressionTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - *, - capture_headers: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = capture_headers - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - *, - target_vm_size: Optional[str] = None, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = target_vm_size - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = id - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the rolling data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_offset: datetime.timedelta, - window_size: datetime.timedelta, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the rolling data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_offset = window_offset - self.window_size = window_size - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = 0, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = max_node_count - self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = scale_settings - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = properties - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, - status: Optional[Union[str, "ScheduleStatus"]] = None, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = id - self.provisioning_status = provisioning_status - self.status = status - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - *, - action: "ScheduleActionBase", - trigger: "TriggerBase", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - display_name: Optional[str] = None, - is_enabled: Optional[bool] = True, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.action = action - self.display_name = display_name - self.is_enabled = is_enabled - self.provisioning_state = None - self.trigger = trigger - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Schedule"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = script_source - self.script_data = script_data - self.script_arguments = script_arguments - self.timeout = timeout - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - *, - startup_script: Optional["ScriptReference"] = None, - creation_script: Optional["ScriptReference"] = None, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = startup_script - self.creation_script = creation_script - - -class SecretExpiry(msrest.serialization.Model): - """Secret expiration configuration. - - :ivar expirable_secret: Indicates if the secret is expirable. - :vartype expirable_secret: bool - :ivar expire_after_hours: Number of hours after which the secret will expire. - :vartype expire_after_hours: int - """ - - _attribute_map = { - 'expirable_secret': {'key': 'expirableSecret', 'type': 'bool'}, - 'expire_after_hours': {'key': 'expireAfterHours', 'type': 'int'}, - } - - def __init__( - self, - *, - expirable_secret: Optional[bool] = False, - expire_after_hours: Optional[int] = 1, - **kwargs - ): - """ - :keyword expirable_secret: Indicates if the secret is expirable. - :paramtype expirable_secret: bool - :keyword expire_after_hours: Number of hours after which the secret will expire. - :paramtype expire_after_hours: int - """ - super(SecretExpiry, self).__init__(**kwargs) - self.expirable_secret = expirable_secret - self.expire_after_hours = expire_after_hours - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - *, - serverless_compute_custom_subnet: Optional[str] = None, - serverless_compute_no_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = serverless_compute_custom_subnet - self.serverless_compute_no_public_ip = serverless_compute_no_public_ip - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "ServerlessEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - capacity_reservation_group_id: str, - endpoint_reserved_capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = capacity_reservation_group_id - self.endpoint_reserved_capacity = endpoint_reserved_capacity - - -class ServerlessEndpointContentSafety(msrest.serialization.Model): - """ServerlessEndpointContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_status: Required. Specifies the status of content safety. Possible values - include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - content_safety_status: Union[str, "ContentSafetyStatus"], - **kwargs - ): - """ - :keyword content_safety_status: Required. Specifies the status of content safety. Possible - values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ServerlessEndpointContentSafety, self).__init__(**kwargs) - self.content_safety_status = content_safety_status - - -class ServerlessEndpointInferenceEndpoint(msrest.serialization.Model): - """ServerlessEndpointInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Dictionary of :code:``. - :vartype headers: dict[str, str] - :ivar uri: Required. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - **kwargs - ): - """ - :keyword uri: Required. - :paramtype uri: str - """ - super(ServerlessEndpointInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = uri - - -class ServerlessEndpointModelSettings(msrest.serialization.Model): - """ServerlessEndpointModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. - :paramtype model_id: str - """ - super(ServerlessEndpointModelSettings, self).__init__(**kwargs) - self.model_id = model_id - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :vartype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :ivar endpoint_state: The current state of the ServerlessEndpoint. Possible values include: - "Unknown", "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", - "CreationFailed", "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription Azure ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_state': {'readonly': True}, - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "ServerlessInferenceEndpointAuthMode"], - content_safety: Optional["ContentSafety"] = None, - model_settings: Optional["ModelSettings"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :paramtype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.content_safety = content_safety - self.endpoint_state = None - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = model_settings - self.provisioning_state = None - - -class ServerlessEndpointResourceProperties(EndpointResourceProperties): - """ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Possible values include: "Key". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar content_safety: - :vartype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :ivar marketplace_subscription_id: - :vartype marketplace_subscription_id: str - :ivar metadata: Anything. - :vartype metadata: any - :ivar model_settings: - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :ivar offer: - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ServerlessEndpointContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessEndpointInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ServerlessEndpointModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - auth_mode: Optional[Union[str, "ServerlessInferenceEndpointAuthMode"]] = None, - capacity_reservation: Optional["ServerlessEndpointCapacityReservation"] = None, - content_safety: Optional["ServerlessEndpointContentSafety"] = None, - endpoint_state: Optional[Union[str, "ServerlessEndpointState"]] = None, - inference_endpoint: Optional["ServerlessEndpointInferenceEndpoint"] = None, - marketplace_subscription_id: Optional[str] = None, - metadata: Optional[Any] = None, - model_settings: Optional["ServerlessEndpointModelSettings"] = None, - offer: Optional["ServerlessOffer"] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Possible values include: "Key". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword content_safety: - :paramtype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :keyword endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :paramtype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :keyword inference_endpoint: - :paramtype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :keyword marketplace_subscription_id: - :paramtype marketplace_subscription_id: str - :keyword metadata: Anything. - :paramtype metadata: any - :keyword model_settings: - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :keyword offer: - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'serverlessEndpoint' # type: str - self.auth_mode = auth_mode - self.capacity_reservation = capacity_reservation - self.content_safety = content_safety - self.endpoint_state = endpoint_state - self.inference_endpoint = inference_endpoint - self.marketplace_subscription_id = marketplace_subscription_id - self.metadata = metadata - self.model_settings = model_settings - self.offer = offer - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ServerlessEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = uri - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. - :vartype offer_name: str - :ivar publisher: Required. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - offer_name: str, - publisher: str, - **kwargs - ): - """ - :keyword offer_name: Required. - :paramtype offer_name: str - :keyword publisher: Required. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = offer_name - self.publisher = publisher - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = cosmos_db - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = credentials - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - *, - action: Optional[Union[str, "RuleAction"]] = None, - address_prefixes: Optional[List[str]] = None, - port_ranges: Optional[str] = None, - protocol: Optional[str] = None, - service_tag: Optional[str] = None, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :paramtype address_prefixes: list[str] - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = action - self.address_prefixes = address_prefixes - self.port_ranges = port_ranges - self.protocol = protocol - self.service_tag = service_tag - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["ServiceTagDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'ServiceTag' # type: str - self.destination = destination - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = scripts - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - group_id: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = name - self.group_id = group_id - self.private_link_resource_id = private_link_resource_id - self.request_message = request_message - self.status = status - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - *, - default: Optional[int] = 0, - maximum: Optional[int] = 0, - minimum: Optional[int] = 0, - scale_type: Optional[Union[str, "SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - self.minimum = minimum - self.scale_type = scale_type - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - *, - capacity: Optional["SkuCapacity"] = None, - sku: Optional["SkuSetting"] = None, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = capacity - self.resource_type = None - self.sku = sku - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["SkuResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] arm-id of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - *, - code_id: str, - entry: "SparkJobEntry", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - services: Optional[Dict[str, "JobService"]] = None, - archives: Optional[List[str]] = None, - args: Optional[str] = None, - conf: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - files: Optional[List[str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jars: Optional[List[str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - py_files: Optional[List[str]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["SparkResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] arm-id of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, services=services, **kwargs) - self.job_type = 'Spark' # type: str - self.archives = archives - self.args = args - self.code_id = code_id - self.conf = conf - self.entry = entry - self.environment_id = environment_id - self.environment_variables = environment_variables - self.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - self.queue_settings = queue_settings - self.resources = resources - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - *, - file: str, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = file - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - *, - class_name: str, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = class_name - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = "3.1", - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.Speech' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(SpeechEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "SslConfigStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = status - self.cert = cert - self.key = key - self.cname = cname - self.leaf_domain_label = leaf_domain_label - self.overwrite_existing_domain = overwrite_existing_domain - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage - self.stack_meta_learner_type = stack_meta_learner_type - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_end: datetime.datetime, - window_start: datetime.datetime, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_end = window_end - self.window_start = window_start - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = system_created_storage_account - self.user_created_storage_account = user_created_storage_account - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: "SamplingAlgorithm", - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - services: Optional[Dict[str, "JobService"]] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = early_termination - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.queue_settings = queue_settings - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = properties - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - *, - auto_scale_properties: Optional["AutoScaleProperties"] = None, - auto_pause_properties: Optional["AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = auto_scale_properties - self.auto_pause_properties = auto_pause_properties - self.spark_version = spark_version - self.node_count = node_count - self.node_size = node_size - self.node_size_family = node_size_family - self.subscription_id = subscription_id - self.resource_group = resource_group - self.workspace_name = workspace_name - self.pool_name = pool_name - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_name: Optional[str] = None, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = acr_account_name - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - allow_blob_public_access: Optional[bool] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_name: Optional[str] = None, - storage_account_type: Optional[str] = None, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = allow_blob_public_access - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_name = storage_account_name - self.storage_account_type = storage_account_type - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, - column_name_and_types: Optional[Dict[str, str]] = None, - enable_dnn_featurization: Optional[bool] = False, - mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - self.blocked_transformers = blocked_transformers - self.column_name_and_types = column_name_and_types - self.enable_dnn_featurization = enable_dnn_featurization - self.mode = mode - self.transformer_params = transformer_params - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - enable_early_termination: Optional[bool] = True, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = 1, - max_cores_per_trial: Optional[int] = -1, - max_trials: Optional[int] = 1000, - timeout: Optional[datetime.timedelta] = "PT6H", - trial_timeout: Optional[datetime.timedelta] = "PT30M", - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = enable_early_termination - self.exit_score = exit_score - self.max_concurrent_trials = max_concurrent_trials - self.max_cores_per_trial = max_cores_per_trial - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - max_instances: Optional[int] = 1, - min_instances: Optional[int] = 1, - polling_interval: Optional[datetime.timedelta] = "PT1S", - target_utilization_percentage: Optional[int] = 70, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = max_instances - self.min_instances = min_instances - self.polling_interval = polling_interval - self.target_utilization_percentage = target_utilization_percentage - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = size - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - top: Optional[int] = 10, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = top - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'triton_model' # type: str - self.description = description - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'triton_model' # type: str - self.description = description - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - limit: Optional[int] = None, - status: Optional[Union[str, "Status"]] = None, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = limit - self.unit = None - self.status = status - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_file' # type: str - self.description = description - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_file' # type: str - self.description = description - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_folder' # type: str - self.description = description - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_folder' # type: str - self.description = description - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = admin_user_name - self.admin_user_ssh_public_key = admin_user_ssh_public_key - self.admin_user_password = admin_user_password - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", - "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "OpenAI", "Serp", "BingLLMSearch", - "Serverless". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = credentials - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = properties - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = id - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - notebook_server_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = virtual_machine_size - self.ssh_port = ssh_port - self.notebook_server_port = notebook_server_port - self.address = address - self.administrator_account = administrator_account - self.is_notebook_instance_compute = is_notebook_instance_compute - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = administrator_account - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) - self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - estimated_vm_prices: Optional["EstimatedVMPrices"] = None, - supported_compute_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = estimated_vm_prices - self.supported_compute_types = supported_compute_types - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = value - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = username - self.password = password - self.public_key_data = public_key_data - self.private_key_data = private_key_data - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "VolumeDefinitionType"]] = "bind", - read_only: Optional[bool] = None, - source: Optional[str] = None, - target: Optional[str] = None, - consistency: Optional[str] = None, - bind: Optional["BindOptions"] = None, - volume: Optional["VolumeOptions"] = None, - tmpfs: Optional["TmpfsOptions"] = None, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = type - self.read_only = read_only - self.source = source - self.target = target - self.consistency = consistency - self.bind = bind - self.volume = volume - self.tmpfs = tmpfs - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = nocopy - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment for - the workspace MSI on resource group level. - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_service_side_cmk_encryption: - :vartype enable_service_side_cmk_encryption: bool - :ivar enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :vartype enable_simplified_cmk: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_service_side_cmk_encryption': {'key': 'properties.enableServiceSideCMKEncryption', 'type': 'bool'}, - 'enable_simplified_cmk': {'key': 'properties.enableSimplifiedCmk', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - allow_public_access_when_behind_vnet: Optional[bool] = None, - allow_role_assignment_on_rg: Optional[bool] = None, - application_insights: Optional[str] = None, - associated_workspaces: Optional[List[str]] = None, - container_registries: Optional[List[str]] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - discovery_url: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_service_side_cmk_encryption: Optional[bool] = None, - enable_simplified_cmk: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionProperty"] = None, - existing_workspaces: Optional[List[str]] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - hbi_workspace: Optional[bool] = None, - hub_resource_id: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - key_vault: Optional[str] = None, - key_vaults: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - soft_delete_retention_in_days: Optional[int] = None, - storage_account: Optional[str] = None, - storage_accounts: Optional[List[str]] = None, - system_datastores_auth_mode: Optional[str] = None, - v1_legacy_mode: Optional[bool] = None, - workspace_hub_config: Optional["WorkspaceHubConfig"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment - for the workspace MSI on resource group level. - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_service_side_cmk_encryption: - :paramtype enable_service_side_cmk_encryption: bool - :keyword enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :paramtype enable_simplified_cmk: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.sku = sku - self.tags = tags - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet - self.allow_role_assignment_on_rg = allow_role_assignment_on_rg - self.application_insights = application_insights - self.associated_workspaces = associated_workspaces - self.container_registries = container_registries - self.container_registry = container_registry - self.description = description - self.discovery_url = discovery_url - self.enable_data_isolation = enable_data_isolation - self.enable_service_side_cmk_encryption = enable_service_side_cmk_encryption - self.enable_simplified_cmk = enable_simplified_cmk - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.existing_workspaces = existing_workspaces - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.hbi_workspace = hbi_workspace - self.hub_resource_id = hub_resource_id - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.key_vault = key_vault - self.key_vaults = key_vaults - self.managed_network = managed_network - self.ml_flow_tracking_uri = None - self.notebook_info = None - self.primary_user_assigned_identity = primary_user_assigned_identity - self.private_endpoint_connections = None - self.private_link_count = None - self.provisioning_state = None - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.service_provisioned_resource_group = None - self.shared_private_link_resources = shared_private_link_resources - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.storage_account = storage_account - self.storage_accounts = storage_accounts - self.storage_hns_enabled = None - self.system_datastores_auth_mode = system_datastores_auth_mode - self.tenant_id = None - self.v1_legacy_mode = v1_legacy_mode - self.workspace_hub_config = workspace_hub_config - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = access_key_id - self.secret_access_key = secret_access_key - - -class WorkspaceConnectionAccountKey(msrest.serialization.Model): - """Account key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionAccountKey, self).__init__(**kwargs) - self.key = key - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = key - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = client_id - self.resource_id = resource_id - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_url: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - developer_token: Optional[str] = None, - password: Optional[str] = None, - refresh_token: Optional[str] = None, - tenant_id: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = auth_url - self.client_id = client_id - self.client_secret = client_secret - self.developer_token = developer_token - self.password = password - self.refresh_token = refresh_token - self.tenant_id = tenant_id - self.username = username - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = pat - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - self.tenant_id = tenant_id - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = sas - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: Optional["WorkspaceConnectionPropertiesV2"] = None, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - security_token: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = password - self.security_token = security_token - self.username = username - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_workspace_storage_accounts: Optional[List[str]] = None, - default_workspace_resource_group: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = additional_workspace_storage_accounts - self.default_workspace_resource_group = default_workspace_resource_group - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Workspace"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar allow_role_assignment_on_rg: - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - allow_role_assignment_on_rg: Optional[bool] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - soft_delete_retention_in_days: Optional[int] = None, - system_datastores_auth_mode: Optional[str] = None, - v1_legacy_mode: Optional[bool] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword allow_role_assignment_on_rg: - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - self.allow_role_assignment_on_rg = allow_role_assignment_on_rg - self.application_insights = application_insights - self.container_registry = container_registry - self.description = description - self.enable_data_isolation = enable_data_isolation - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.managed_network = managed_network - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.system_datastores_auth_mode = system_datastores_auth_mode - self.v1_legacy_mode = v1_legacy_mode diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/__init__.py deleted file mode 100644 index f76d571ef953..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/__init__.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._jobs_operations import JobsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._connection_operations import ConnectionOperations -from ._connection_rai_blocklists_operations import ConnectionRaiBlocklistsOperations -from ._connection_rai_blocklist_operations import ConnectionRaiBlocklistOperations -from ._connection_rai_blocklist_item_operations import ConnectionRaiBlocklistItemOperations -from ._connection_rai_blocklist_items_operations import ConnectionRaiBlocklistItemsOperations -from ._connection_rai_policies_operations import ConnectionRaiPoliciesOperations -from ._connection_rai_policy_operations import ConnectionRaiPolicyOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._rai_policies_operations import RaiPoliciesOperations -from ._rai_policy_operations import RaiPolicyOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'MarketplaceSubscriptionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ConnectionOperations', - 'ConnectionRaiBlocklistsOperations', - 'ConnectionRaiBlocklistOperations', - 'ConnectionRaiBlocklistItemOperations', - 'ConnectionRaiBlocklistItemsOperations', - 'ConnectionRaiPoliciesOperations', - 'ConnectionRaiPolicyOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'RaiPoliciesOperations', - 'RaiPolicyOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 6c0b23577bbb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,876 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchDeploymentsOperations(object): - """BatchDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index ca0156cabe89..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,934 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchEndpointsOperations(object): - """BatchEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index 0e0e2c8cab95..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,511 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index cfeeb2722720..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,873 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - hash = kwargs.pop('hash', None) # type: Optional[str] - hash_version = kwargs.pop('hash_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if hash is not None: - _query_parameters['hash'] = _SERIALIZER.query("hash", hash, 'str') - if hash_version is not None: - _query_parameters['hashVersion'] = _SERIALIZER.query("hash_version", hash_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeVersionsOperations(object): - """CodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - hash=None, # type: Optional[str] - hash_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 52a3b8ef884e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 9862e70624df..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,743 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentVersionsOperations(object): - """ComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_compute_operations.py deleted file mode 100644 index 1625166ed48a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,2101 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - underlying_resource_action = kwargs.pop('underlying_resource_action') # type: Union[str, "_models.UnderlyingResourceAction"] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - _query_parameters['underlyingResourceAction'] = _SERIALIZER.query("underlying_resource_action", underlying_resource_action, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_custom_services_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_nodes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_data_mounts_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_start_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_stop_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_restart_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_idle_shutdown_setting_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_allowed_resize_sizes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_resize_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComputeOperations(object): # pylint: disable=too-many-public-methods - """ComputeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PaginatedComputeResourcesList"] - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PaginatedComputeResourcesList or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - @distributed_trace - def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - custom_services, # type: List["_models.CustomService"] - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - - - @distributed_trace - def list_nodes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlComputeNodesInformation"] - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AmlComputeNodesInformation or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeSecrets" - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace - def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - data_mounts, # type: List["_models.ComputeInstanceDataMount"] - **kwargs # type: Any - ): - # type: (...) -> None - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace - def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace - def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace - def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - @distributed_trace - def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.IdleShutdownSetting" - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - - - @distributed_trace - def get_allowed_resize_sizes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace - def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_operations.py deleted file mode 100644 index 40800e7d139d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_operations.py +++ /dev/null @@ -1,886 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_deployments_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_deployment_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_deployment_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_deployment_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionOperations(object): - """ConnectionOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_deployments( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_deployments.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_deployments.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments"} # type: ignore - - def _delete_deployment_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete_deployment( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_deployment( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_deployment_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get_deployment.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - def _create_or_update_deployment_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update_deployment( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"] - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointModels"] - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models"} # type: ignore - - @distributed_trace - def list_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointModels" - """Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointModels, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointModels - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointModels', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_item_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_item_operations.py deleted file mode 100644 index 5e138f0b4b6f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_item_operations.py +++ /dev/null @@ -1,914 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_add_bulk_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_bulk_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistItemOperations(object): - """ConnectionRaiBlocklistItemOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _add_bulk_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: List["_models.RaiBlocklistItemBulkRequest"] - **kwargs # type: Any - ): - # type: (...) -> Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, '[RaiBlocklistItemBulkRequest]') - - request = build_add_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._add_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _add_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - - @distributed_trace - def begin_add_bulk( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: List["_models.RaiBlocklistItemBulkRequest"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. - :type body: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemBulkRequest] - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either list of - RaiBlocklistItemPropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource]] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._add_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_add_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - def _delete_bulk_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_delete_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._delete_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - - @distributed_trace - def begin_delete_bulk( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. - :type body: any - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistItemPropertiesBasicResource" - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistItemPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - body, # type: "_models.RaiBlocklistItemPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistItemPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistItemPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - body, # type: "_models.RaiBlocklistItemPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiBlocklistItemPropertiesBasicResource"] - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiBlocklistItemPropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_items_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_items_operations.py deleted file mode 100644 index faa4b2403831..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_items_operations.py +++ /dev/null @@ -1,192 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistItemsOperations(object): - """ConnectionRaiBlocklistItemsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_operations.py deleted file mode 100644 index 2af19bb9f02a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklist_operations.py +++ /dev/null @@ -1,521 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistOperations(object): - """ConnectionRaiBlocklistOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistPropertiesBasicResource" - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: "_models.RaiBlocklistPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: "_models.RaiBlocklistPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiBlocklistPropertiesBasicResource"] - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiBlocklistPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklists_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklists_operations.py deleted file mode 100644 index 1f2feb3c08a0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_blocklists_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistsOperations(object): - """ConnectionRaiBlocklistsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policies_operations.py deleted file mode 100644 index cd58eec2db66..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policies_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiPoliciesOperations(object): - """ConnectionRaiPoliciesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policy_operations.py deleted file mode 100644 index 0a4494d973c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_connection_rai_policy_operations.py +++ /dev/null @@ -1,521 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiPolicyOperations(object): - """ConnectionRaiPolicyOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiPolicyPropertiesBasicResource"] - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiPolicyPropertiesBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index 77209831fe02..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index 4f4647bffa41..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,755 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataVersionsOperations(object): - """DataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 195e6532e18b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,684 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', 30) # type: Optional[int] - is_default = kwargs.pop('is_default', None) # type: Optional[bool] - names = kwargs.pop('names', None) # type: Optional[List[str]] - search_text = kwargs.pop('search_text', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - order_by_asc = kwargs.pop('order_by_asc', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if is_default is not None: - _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') - if names is not None: - _query_parameters['names'] = _SERIALIZER.query("names", names, '[str]', div=',') - if search_text is not None: - _query_parameters['searchText'] = _SERIALIZER.query("search_text", search_text, 'str') - if order_by is not None: - _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if order_by_asc is not None: - _query_parameters['orderByAsc'] = _SERIALIZER.query("order_by_asc", order_by_asc, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - skip_validation = kwargs.pop('skip_validation', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip_validation is not None: - _query_parameters['skipValidation'] = _SERIALIZER.query("skip_validation", skip_validation, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DatastoresOperations(object): - """DatastoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=30, # type: Optional[int] - is_default=None, # type: Optional[bool] - names=None, # type: Optional[List[str]] - search_text=None, # type: Optional[str] - order_by=None, # type: Optional[str] - order_by_asc=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DatastoreResourceArmPaginatedResult"] - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Datastore" - skip_validation=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body=None, # type: Optional["_models.SecretExpiry"] - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreSecrets" - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Secret expiry information. - :type body: ~azure.mgmt.machinelearningservices.models.SecretExpiry - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'SecretExpiry') - else: - _json = None - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_deployment_operations.py deleted file mode 100644 index 63041756bd6b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,801 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_in_workspace_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointDeploymentOperations(object): - """EndpointDeploymentOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"] - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_operations.py deleted file mode 100644 index 3b67e109e1f4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_endpoint_operations.py +++ /dev/null @@ -1,851 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - include_inference_endpoints = kwargs.pop('include_inference_endpoints', False) # type: Optional[bool] - skip = kwargs.pop('skip', None) # type: Optional[str] - expand = kwargs.pop('expand', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if include_inference_endpoints is not None: - _query_parameters['includeInferenceEndpoints'] = _SERIALIZER.query("include_inference_endpoints", include_inference_endpoints, 'bool') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if expand is not None: - _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointOperations(object): - """EndpointOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - include_inference_endpoints=False, # type: Optional[bool] - skip=None, # type: Optional[str] - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param include_inference_endpoints: - :type include_inference_endpoints: bool - :param skip: Continuation token for pagination. - :type skip: str - :param expand: Whether the endpoint resource will be expand to include deployment information, - e.g. $expand=deployments. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_inference_endpoints=include_inference_endpoints, - skip=skip, - expand=expand, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointResourcePropertiesBasicResource" - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointResourcePropertiesBasicResource"] - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointResourcePropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointKeys" - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointModels"] - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace - def regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateServiceAccountKeyContent" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountApiKeys" - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index 770ccd4b6f47..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index e58244215b7f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,743 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentVersionsOperations(object): - """EnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_features_operations.py deleted file mode 100644 index c27fd9956592..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_features_operations.py +++ /dev/null @@ -1,359 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - feature_name = kwargs.pop('feature_name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 1000) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if feature_name is not None: - _query_parameters['featureName'] = _SERIALIZER.query("feature_name", feature_name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - "featureName": _SERIALIZER.url("feature_name", feature_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesOperations(object): - """FeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - feature_name=None, # type: Optional[str] - description=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=1000, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeatureResourceArmPaginatedResult"] - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Feature" - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index 1decbe5b41dd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetContainersOperations(object): - """FeaturesetContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index de2c89112158..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,924 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_backfill_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetVersionsOperations(object): - """FeaturesetVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - def _backfill_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.FeaturesetVersionBackfillResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace - def begin_backfill( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersionBackfillResponse"] - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersionBackfillResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index ee007eb9a511..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityContainersOperations(object): - """FeaturestoreEntityContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 06141b4aa76d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityVersionsOperations(object): - """FeaturestoreEntityVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 0b5279034e3d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,766 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - job_type = kwargs.pop('job_type', None) # type: Optional[str] - tag = kwargs.pop('tag', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - properties = kwargs.pop('properties', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if job_type is not None: - _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') - if tag is not None: - _query_parameters['tag'] = _SERIALIZER.query("tag", tag, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_cancel_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - job_type=None, # type: Optional[str] - tag=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - properties=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobBaseResourceArmPaginatedResult"] - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param properties: Comma-separated list of user property names (and optionally values). - Example: prop1,prop2=value2. - :type properties: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.JobBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - - - @distributed_trace - def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 39670464fcfe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,234 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_provision_managed_network_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkProvisionsOperations(object): - """ManagedNetworkProvisionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _provision_managed_network_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace - def begin_provision_managed_network( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedNetworkProvisionStatus"] - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 0b3ffcf38431..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,629 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkSettingsRuleOperations(object): - """ManagedNetworkSettingsRuleOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundRuleListResult"] - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OutboundRuleBasicResource" - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OutboundRuleBasicResource"] - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OutboundRuleBasicResource or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index 042f7965189c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class MarketplaceSubscriptionsOperations(object): - """MarketplaceSubscriptionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MarketplaceSubscription"] - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either MarketplaceSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index f89c1c303173..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=None, # type: Optional[int] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index f655ddd6faa8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,793 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - offset = kwargs.pop('offset', None) # type: Optional[int] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - feed = kwargs.pop('feed', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if offset is not None: - _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if feed is not None: - _query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - offset=None, # type: Optional[int] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - feed=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 93c353e4531a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1150 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_logs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineDeploymentsOperations(object): - """OnlineDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_logs( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.DeploymentLogsRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeploymentLogs" - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeploymentLogs, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index 53ce9a342b57..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1257 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - name = kwargs.pop('name', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - compute_type = kwargs.pop('compute_type', None) # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if compute_type is not None: - _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineEndpointsOperations(object): - """OnlineEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name=None, # type: Optional[str] - count=None, # type: Optional[int] - compute_type=None, # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - @distributed_trace - def get_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthToken" - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthToken, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_operations.py deleted file mode 100644 index f148f6ba0321..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_operations.py +++ /dev/null @@ -1,155 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.MachineLearningServices/operations") - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index ff22f79a7d86..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,501 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - body, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index a4081b088e55..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,190 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateLinkResourceListResult"] - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_quotas_operations.py deleted file mode 100644 index a1462cc18cf0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_update_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas") # pylint: disable=line-too-long - path_format_arguments = { - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class QuotasOperations(object): - """QuotasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def update( - self, - location, # type: str - parameters, # type: "_models.QuotaUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateWorkspaceQuotasResult" - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateWorkspaceQuotasResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListWorkspaceQuotas"] - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policies_operations.py deleted file mode 100644 index 8f0205490c87..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policies_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RaiPoliciesOperations(object): - """RaiPoliciesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policy_operations.py deleted file mode 100644 index 52d42b073e7e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_rai_policy_operations.py +++ /dev/null @@ -1,521 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RaiPolicyOperations(object): - """RaiPolicyOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiPolicyPropertiesBasicResource"] - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiPolicyPropertiesBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registries_operations.py deleted file mode 100644 index a1bc23f441f5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_remove_regions_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistriesOperations(object): - """RegistriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - def _remove_regions_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace - def begin_remove_regions( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index e439e73e3063..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,636 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeContainersOperations(object): - """RegistryCodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeContainer"] - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index 82c1b5bad4d3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,802 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeVersionsOperations(object): - """RegistryCodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index c853218269ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentContainersOperations(object): - """RegistryComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index 652f98a25cbc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,682 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentVersionsOperations(object): - """RegistryComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index ffaab3311aa9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,644 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataContainersOperations(object): - """RegistryDataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_references_operations.py deleted file mode 100644 index 679fc539bb91..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,174 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_blob_reference_sas_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataReferencesOperations(object): - """RegistryDataReferencesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_blob_reference_sas( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.GetBlobReferenceSASRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.GetBlobReferenceSASResponseDto" - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index 9265c455c244..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataVersionsOperations(object): - """RegistryDataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataVersionBase"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 8cbc59494269..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentContainersOperations(object): - """RegistryEnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 4c809a0aa5e5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentVersionsOperations(object): - """RegistryEnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index 02fa0bbc9965..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelContainersOperations(object): - """RegistryModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelContainer"] - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index fe9b986eb405..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,844 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelVersionsOperations(object): - """RegistryModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_schedules_operations.py deleted file mode 100644 index 441dfb224c32..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_schedules_operations.py +++ /dev/null @@ -1,643 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ScheduleListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SchedulesOperations(object): - """SchedulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ScheduleListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ScheduleResourceArmPaginatedResult"] - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Schedule, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Schedule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Schedule"] - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Schedule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 6024be4c6bf9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,1112 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z][a-zA-Z0-9-]{0,51}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ServerlessEndpointsOperations(object): - """ServerlessEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ServerlessEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointAuthKeys"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointAuthKeys"] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_usages_operations.py deleted file mode 100644 index 52bc775ea17a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListUsagesResult"] - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListUsagesResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index e34658907c6e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes") # pylint: disable=line-too-long - path_format_arguments = { - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class VirtualMachineSizesOperations(object): - """VirtualMachineSizesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 74bd83fac784..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,929 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - include_all = kwargs.pop('include_all', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if target is not None: - _query_parameters['target'] = _SERIALIZER.query("target", target, 'str') - if category is not None: - _query_parameters['category'] = _SERIALIZER.query("category", category, 'str') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if include_all is not None: - _query_parameters['includeAll'] = _SERIALIZER.query("include_all", include_all, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_test_connection_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceConnectionsOperations(object): - """WorkspaceConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - target=None, # type: Optional[str] - category=None, # type: Optional[str] - include_all=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionUpdateParameter"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace - def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 260def2d74d2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceFeaturesOperations(object): - """WorkspaceFeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListAmlUserFeatureResult"] - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListAmlUserFeatureResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index e97e921285db..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1923 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - force_to_purge = kwargs.pop('force_to_purge', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if force_to_purge is not None: - _query_parameters['forceToPurge'] = _SERIALIZER.query("force_to_purge", force_to_purge, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_diagnose_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_notebook_access_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_notebook_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_storage_account_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_outbound_network_dependencies_endpoints_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_prepare_notebook_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_resync_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspacesOperations(object): - """WorkspacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Workspace" - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - def _diagnose_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace - def begin_diagnose( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DiagnoseResponseResult"] - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiagnoseResponseResult or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListWorkspaceKeysResult" - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListWorkspaceKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace - def list_notebook_access_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NotebookAccessTokenResult" - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NotebookAccessTokenResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace - def list_notebook_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListNotebookKeysResult" - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListNotebookKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace - def list_storage_account_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListStorageAccountKeysResult" - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListStorageAccountKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace - def list_outbound_network_dependencies_endpoints( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExternalFQDNResponse" - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalFQDNResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - def _prepare_notebook_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace - def begin_prepare_notebook( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NotebookResourceInfo"] - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace - def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2024-07-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 1ecb61ce1492..cee238afb404 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -308,11 +308,6 @@ def mock_aml_services_2024_01_01_preview(mocker: MockFixture) -> Mock: return mocker.patch("azure.ai.ml._restclient.v2024_01_01_preview") -@pytest.fixture -def mock_aml_services_2024_07_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2024_07_01_preview") - - @pytest.fixture def mock_aml_services_2024_10_01_preview(mocker: MockFixture) -> Mock: return mocker.patch("azure.ai.ml._restclient.v2024_10_01_preview_tsp") From 92839cc5624c9421bfe29d48f8cdeb4019a9fa5d Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Thu, 18 Jun 2026 19:24:18 +0530 Subject: [PATCH 3/6] Migrate v2025_01_01_preview consumers to shared arm_ml_service client Reuse the existing arm_ml_service generated client for the v2025_01_01_preview API surface instead of importing from the per-version restclient package, and delete azure/ai/ml/_restclient/v2025_01_01_preview/. - _ml_client: wire the v2025_01_01_preview service client via a partial of MachineLearningServicesMgmtClient with api_version='2025-01-01-preview'. - Switch production imports (command builder/entity, job_resource_configuration, to_rest_functions, capability_host entity + operations) from azure.ai.ml._restclient.v2025_01_01_preview to azure.ai.ml._restclient.arm_ml_service. - command_job.py: the shared CommandJob hybrid model does not declare parent_job_name, but it is a real field on the 2025-01-01-preview wire contract (wire key 'parentJobName'). Preserve it via dict-style assignment on the rest model rather than passing it as a constructor kwarg, and read it back via dict access in _load_from_rest. - job_resource_configuration.py: same situation for max_instance_count (wire key 'maxInstanceCount', still declared on v2023_04_01_preview). Set it on the wire via dict assignment on the 202501 branch and read it back via obj.get('maxInstanceCount') for the hybrid model. Verified the value survives serialization and round-trip. - Update conftest mock fixture and capability host entity test to import from arm_ml_service. - test_command_job_schema: environment_variables is Dict[str, str] on the REST contract; the shared client coerces values to strings, so assert against the stringified expected values. - Delete the now-unused azure/ai/ml/_restclient/v2025_01_01_preview/ package. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 +- .../v2025_01_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 336 - .../v2025_01_01_preview/_configuration.py | 76 - .../_restclient/v2025_01_01_preview/_patch.py | 31 - .../v2025_01_01_preview/_vendor.py | 27 - .../v2025_01_01_preview/_version.py | 9 - .../v2025_01_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 332 - .../v2025_01_01_preview/aio/_configuration.py | 72 - .../v2025_01_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 139 - .../_batch_deployments_operations.py | 642 - .../operations/_batch_endpoints_operations.py | 675 - .../_capability_hosts_operations.py | 370 - .../operations/_code_containers_operations.py | 339 - .../operations/_code_versions_operations.py | 590 - .../_component_containers_operations.py | 344 - .../_component_versions_operations.py | 508 - .../aio/operations/_compute_operations.py | 1465 - .../aio/operations/_connection_operations.py | 652 - ...onnection_rai_blocklist_item_operations.py | 694 - ...nnection_rai_blocklist_items_operations.py | 146 - .../_connection_rai_blocklist_operations.py | 393 - .../_connection_rai_blocklists_operations.py | 141 - .../_connection_rai_policies_operations.py | 141 - .../_connection_rai_policy_operations.py | 393 - .../operations/_data_containers_operations.py | 344 - .../operations/_data_versions_operations.py | 517 - .../aio/operations/_datastores_operations.py | 448 - .../_endpoint_deployment_operations.py | 584 - .../aio/operations/_endpoint_operations.py | 597 - .../_environment_containers_operations.py | 344 - .../_environment_versions_operations.py | 508 - .../aio/operations/_features_operations.py | 247 - .../_featureset_containers_operations.py | 495 - .../_featureset_versions_operations.py | 672 - ...aturestore_entity_containers_operations.py | 495 - ...featurestore_entity_versions_operations.py | 526 - .../_inference_endpoints_operations.py | 654 - .../_inference_groups_operations.py | 1145 - .../operations/_inference_pools_operations.py | 628 - .../aio/operations/_jobs_operations.py | 540 - .../_managed_network_provisions_operations.py | 183 - ...anaged_network_settings_rule_operations.py | 458 - .../_marketplace_subscriptions_operations.py | 463 - .../_model_containers_operations.py | 349 - .../operations/_model_versions_operations.py | 540 - .../_online_deployments_operations.py | 823 - .../_online_endpoints_operations.py | 897 - .../aio/operations/_operations.py | 118 - ...private_endpoint_connections_operations.py | 332 - .../_private_link_resources_operations.py | 143 - .../aio/operations/_ptu_quota_operations.py | 275 - .../aio/operations/_quotas_operations.py | 186 - .../operations/_rai_policies_operations.py | 141 - .../aio/operations/_rai_policy_operations.py | 393 - .../aio/operations/_registries_operations.py | 710 - .../_registry_code_containers_operations.py | 463 - .../_registry_code_versions_operations.py | 570 - ...egistry_component_containers_operations.py | 463 - ..._registry_component_versions_operations.py | 494 - .../_registry_data_containers_operations.py | 468 - .../_registry_data_references_operations.py | 120 - .../_registry_data_versions_operations.py | 584 - ...istry_environment_containers_operations.py | 468 - ...egistry_environment_versions_operations.py | 499 - .../_registry_model_containers_operations.py | 468 - .../_registry_model_versions_operations.py | 597 - .../aio/operations/_schedules_operations.py | 467 - .../_serverless_endpoints_operations.py | 810 - .../aio/operations/_usages_operations.py | 124 - .../_virtual_machine_sizes_operations.py | 99 - .../_workspace_connections_operations.py | 624 - .../_workspace_features_operations.py | 129 - .../aio/operations/_workspaces_operations.py | 1357 - .../v2025_01_01_preview/models/__init__.py | 2300 - ...azure_machine_learning_workspaces_enums.py | 2133 - .../v2025_01_01_preview/models/_models.py | 34035 -------------- .../v2025_01_01_preview/models/_models_py3.py | 37001 ---------------- .../operations/__init__.py | 139 - .../_batch_deployments_operations.py | 876 - .../operations/_batch_endpoints_operations.py | 934 - .../_capability_hosts_operations.py | 504 - .../operations/_code_containers_operations.py | 511 - .../operations/_code_versions_operations.py | 873 - .../_component_containers_operations.py | 519 - .../_component_versions_operations.py | 743 - .../operations/_compute_operations.py | 2101 - .../operations/_connection_operations.py | 920 - ...onnection_rai_blocklist_item_operations.py | 938 - ...nnection_rai_blocklist_items_operations.py | 200 - .../_connection_rai_blocklist_operations.py | 539 - .../_connection_rai_blocklists_operations.py | 193 - .../_connection_rai_policies_operations.py | 193 - .../_connection_rai_policy_operations.py | 539 - .../operations/_data_containers_operations.py | 519 - .../operations/_data_versions_operations.py | 755 - .../operations/_datastores_operations.py | 684 - .../_endpoint_deployment_operations.py | 810 - .../operations/_endpoint_operations.py | 867 - .../_environment_containers_operations.py | 519 - .../_environment_versions_operations.py | 743 - .../operations/_features_operations.py | 359 - .../_featureset_containers_operations.py | 687 - .../_featureset_versions_operations.py | 924 - ...aturestore_entity_containers_operations.py | 687 - ...featurestore_entity_versions_operations.py | 732 - .../_inference_endpoints_operations.py | 894 - .../_inference_groups_operations.py | 1611 - .../operations/_inference_pools_operations.py | 856 - .../operations/_jobs_operations.py | 766 - .../_managed_network_provisions_operations.py | 234 - ...anaged_network_settings_rule_operations.py | 629 - .../_marketplace_subscriptions_operations.py | 637 - .../_model_containers_operations.py | 527 - .../operations/_model_versions_operations.py | 793 - .../_online_deployments_operations.py | 1150 - .../_online_endpoints_operations.py | 1257 - .../operations/_operations.py | 155 - ...private_endpoint_connections_operations.py | 501 - .../_private_link_resources_operations.py | 190 - .../operations/_ptu_quota_operations.py | 397 - .../operations/_quotas_operations.py | 269 - .../operations/_rai_policies_operations.py | 193 - .../operations/_rai_policy_operations.py | 539 - .../operations/_registries_operations.py | 988 - .../_registry_code_containers_operations.py | 636 - .../_registry_code_versions_operations.py | 802 - ...egistry_component_containers_operations.py | 637 - ..._registry_component_versions_operations.py | 682 - .../_registry_data_containers_operations.py | 644 - .../_registry_data_references_operations.py | 174 - .../_registry_data_versions_operations.py | 823 - ...istry_environment_containers_operations.py | 645 - ...egistry_environment_versions_operations.py | 690 - .../_registry_model_containers_operations.py | 645 - .../_registry_model_versions_operations.py | 844 - .../operations/_schedules_operations.py | 643 - .../_serverless_endpoints_operations.py | 1112 - .../operations/_usages_operations.py | 169 - .../_virtual_machine_sizes_operations.py | 144 - .../_workspace_connections_operations.py | 929 - .../_workspace_features_operations.py | 176 - .../operations/_workspaces_operations.py | 1923 - .../_restclient/v2025_01_01_preview/py.typed | 1 - .../azure/ai/ml/entities/_builders/command.py | 4 +- .../azure/ai/ml/entities/_job/command_job.py | 11 +- .../_job/job_resource_configuration.py | 19 +- .../ai/ml/entities/_job/to_rest_functions.py | 2 +- .../_ai_workspaces/capability_host.py | 6 +- .../_capability_hosts_operations.py | 6 +- .../unittests/test_command_job_schema.py | 5 +- sdk/ml/azure-ai-ml/tests/conftest.py | 2 +- .../unittests/test_capability_host_entity.py | 6 +- 155 files changed, 36 insertions(+), 151547 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_capability_hosts_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklists_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_ptu_quota_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_capability_hosts_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_item_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_items_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklists_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_datastores_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_deployment_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_groups_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_pools_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_provisions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_settings_rule_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_marketplace_subscriptions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_deployments_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_ptu_quota_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policies_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policy_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registries_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_references_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_containers_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_versions_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_schedules_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_serverless_endpoints_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 2fcd7093a582..8d3253c8dd95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -35,7 +35,6 @@ from azure.ai.ml._restclient.v2024_10_01_preview_tsp import ( MachineLearningServicesMgmtClient as ServiceClient102024PreviewTsp, ) -from azure.ai.ml._restclient.v2025_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012025Preview from azure.ai.ml._restclient.workspace_dataplane import WorkspaceDataplaneClient as ServiceClientWorkspaceDataplane from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope from azure.ai.ml._telemetry.logging_handler import configure_appinsights_logging @@ -109,6 +108,7 @@ ServiceClient042023 = partial(MachineLearningServicesMgmtClient, api_version="2023-04-01") ServiceClient102023 = partial(MachineLearningServicesMgmtClient, api_version="2023-10-01") ServiceClient022022Preview = partial(MachineLearningServicesMgmtClient, api_version="2022-02-01-preview") +ServiceClient012025Preview = partial(MachineLearningServicesMgmtClient, api_version="2025-01-01-preview") module_logger = logging.getLogger(__name__) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index c4c23867c84d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,336 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.mgmt.core import ARMPipelineClient - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapabilityHostsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PTUQuotaOperations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations - :ivar ptu_quota: PTUQuotaOperations operations - :vartype ptu_quota: azure.mgmt.machinelearningservices.operations.PTUQuotaOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations - :ivar capability_hosts: CapabilityHostsOperations operations - :vartype capability_hosts: - azure.mgmt.machinelearningservices.operations.CapabilityHostsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: azure.mgmt.machinelearningservices.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: azure.mgmt.machinelearningservices.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.operations.JobsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.operations.MarketplaceSubscriptionsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: azure.mgmt.machinelearningservices.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations - :ivar connection: ConnectionOperations operations - :vartype connection: azure.mgmt.machinelearningservices.operations.ConnectionOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.mgmt.machinelearningservices.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.mgmt.machinelearningservices.operations.ConnectionRaiPoliciesOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.mgmt.machinelearningservices.operations.ConnectionRaiPolicyOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.operations.EndpointOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: azure.mgmt.machinelearningservices.operations.RaiPoliciesOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: azure.mgmt.machinelearningservices.operations.RaiPolicyOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2025-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.ptu_quota = PTUQuotaOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.capability_hosts = CapabilityHostsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policies = ConnectionRaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policy = ConnectionRaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_configuration.py deleted file mode 100644 index 6eed0f8a8a28..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_configuration.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :keyword api_version: Api Version. The default value is "2025-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 620f865f73ce..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,332 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from msrest import Deserializer, Serializer - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapabilityHostsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PTUQuotaOperations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.aio.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.aio.operations.ComputeOperations - :ivar registries: RegistriesOperations operations - :vartype registries: azure.mgmt.machinelearningservices.aio.operations.RegistriesOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations - :ivar ptu_quota: PTUQuotaOperations operations - :vartype ptu_quota: azure.mgmt.machinelearningservices.aio.operations.PTUQuotaOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeContainersOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataVersionsOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.mgmt.machinelearningservices.aio.operations.RegistryDataReferencesOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.mgmt.machinelearningservices.aio.operations.RegistryModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.mgmt.machinelearningservices.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations - :ivar capability_hosts: CapabilityHostsOperations operations - :vartype capability_hosts: - azure.mgmt.machinelearningservices.aio.operations.CapabilityHostsOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.mgmt.machinelearningservices.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.mgmt.machinelearningservices.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.mgmt.machinelearningservices.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.mgmt.machinelearningservices.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.mgmt.machinelearningservices.aio.operations.DataVersionsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: azure.mgmt.machinelearningservices.aio.operations.DatastoresOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.mgmt.machinelearningservices.aio.operations.EnvironmentVersionsOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: azure.mgmt.machinelearningservices.aio.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.mgmt.machinelearningservices.aio.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.mgmt.machinelearningservices.aio.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.mgmt.machinelearningservices.aio.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.mgmt.machinelearningservices.aio.operations.InferenceGroupsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.machinelearningservices.aio.operations.JobsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.mgmt.machinelearningservices.aio.operations.MarketplaceSubscriptionsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.mgmt.machinelearningservices.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.mgmt.machinelearningservices.aio.operations.ModelVersionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.mgmt.machinelearningservices.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.mgmt.machinelearningservices.aio.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: azure.mgmt.machinelearningservices.aio.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.mgmt.machinelearningservices.aio.operations.ServerlessEndpointsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.aio.operations.WorkspacesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations - :ivar connection: ConnectionOperations operations - :vartype connection: azure.mgmt.machinelearningservices.aio.operations.ConnectionOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiPoliciesOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.mgmt.machinelearningservices.aio.operations.ConnectionRaiPolicyOperations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.mgmt.machinelearningservices.aio.operations.EndpointDeploymentOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: azure.mgmt.machinelearningservices.aio.operations.EndpointOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: azure.mgmt.machinelearningservices.aio.operations.RaiPoliciesOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: azure.mgmt.machinelearningservices.aio.operations.RaiPolicyOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.aio.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkProvisionsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2025-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.ptu_quota = PTUQuotaOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_references = RegistryDataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.capability_hosts = CapabilityHostsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_groups = InferenceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policies = ConnectionRaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.connection_rai_policy = ConnectionRaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_configuration.py deleted file mode 100644 index 89d0dac9a382..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :keyword api_version: Api Version. The default value is "2025-01-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/__init__.py deleted file mode 100644 index 9f0cf9c2520b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._ptu_quota_operations import PTUQuotaOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._capability_hosts_operations import CapabilityHostsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._jobs_operations import JobsOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._connection_operations import ConnectionOperations -from ._connection_rai_blocklists_operations import ConnectionRaiBlocklistsOperations -from ._connection_rai_blocklist_operations import ConnectionRaiBlocklistOperations -from ._connection_rai_blocklist_item_operations import ConnectionRaiBlocklistItemOperations -from ._connection_rai_blocklist_items_operations import ConnectionRaiBlocklistItemsOperations -from ._connection_rai_policies_operations import ConnectionRaiPoliciesOperations -from ._connection_rai_policy_operations import ConnectionRaiPolicyOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._rai_policies_operations import RaiPoliciesOperations -from ._rai_policy_operations import RaiPolicyOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'PTUQuotaOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CapabilityHostsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'MarketplaceSubscriptionsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ConnectionOperations', - 'ConnectionRaiBlocklistsOperations', - 'ConnectionRaiBlocklistOperations', - 'ConnectionRaiBlocklistItemOperations', - 'ConnectionRaiBlocklistItemsOperations', - 'ConnectionRaiPoliciesOperations', - 'ConnectionRaiPolicyOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'RaiPoliciesOperations', - 'RaiPolicyOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index dbc23f3ecb8b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,642 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchDeploymentsOperations: - """BatchDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.BatchDeployment": - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.BatchDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchDeployment"]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index 3cc60233fb65..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BatchEndpointsOperations: - """BatchEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.BatchEndpoint": - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.BatchEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.BatchEndpoint"]: - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_capability_hosts_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_capability_hosts_operations.py deleted file mode 100644 index b382ba226373..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_capability_hosts_operations.py +++ /dev/null @@ -1,370 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._capability_hosts_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CapabilityHostsOperations: - """CapabilityHostsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete capabilityHost. - - Delete capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: CapabilityHost name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CapabilityHost": - """Get capabilityHost. - - Get capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: CapabilityHost name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapabilityHost, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapabilityHost - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapabilityHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CapabilityHost", - **kwargs: Any - ) -> "_models.CapabilityHost": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapabilityHost') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CapabilityHost', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CapabilityHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CapabilityHost", - **kwargs: Any - ) -> AsyncLROPoller["_models.CapabilityHost"]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: CapabilityHost name. - :type name: str - :param body: CapabilityHost definition. - :type body: ~azure.mgmt.machinelearningservices.models.CapabilityHost - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CapabilityHost or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CapabilityHost] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CapabilityHost', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index bc63a02004a5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeContainersOperations: - """CodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index bac78393938c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,590 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class CodeVersionsOperations: - """CodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index a7fd4c57c69f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentContainersOperations: - """ComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 1995ca56c5fb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,508 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentVersionsOperations: - """ComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index b81d4ed616af..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1465 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_allowed_resize_sizes_request, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_resize_request_initial, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_data_mounts_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComputeOperations: # pylint: disable=too-many-public-methods - """ComputeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PaginatedComputeResourcesList or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeResource": - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - @distributed_trace_async - async def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List["_models.CustomService"], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - - - @distributed_trace - def list_nodes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AmlComputeNodesInformation or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeSecrets": - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List["_models.ComputeInstanceDataMount"], - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - async def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace_async - async def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace_async - async def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - async def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace_async - async def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - @distributed_trace_async - async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.IdleShutdownSetting", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - - - @distributed_trace_async - async def get_allowed_resize_sizes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - async def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace_async - async def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ResizeSchema", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_operations.py deleted file mode 100644 index 0ddb4280c780..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_operations.py +++ /dev/null @@ -1,652 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_operations import build_create_or_update_deployment_request_initial, build_delete_deployment_request_initial, build_get_all_models_request, build_get_deployment_request, build_get_models_request, build_list_deployments_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionOperations: - """ConnectionOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_deployments( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list_deployments.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_deployments.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments"} # type: ignore - - async def _delete_deployment_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete_deployment( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_deployment_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get_deployment.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - async def _create_or_update_deployment_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_or_update_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointModels"]: - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models"} # type: ignore - - @distributed_trace_async - async def get_all_models( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.EndpointModels": - """Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointModels, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointModels - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_all_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get_all_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointModels', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_all_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py deleted file mode 100644 index 4a1e8b924a10..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_item_operations.py +++ /dev/null @@ -1,694 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_item_operations import build_add_bulk_request_initial, build_create_request_initial, build_delete_bulk_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistItemOperations: - """ConnectionRaiBlocklistItemOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _add_bulk_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List["_models.RaiBlocklistItemBulkRequest"], - **kwargs: Any - ) -> Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, '[RaiBlocklistItemBulkRequest]') - - request = build_add_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._add_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _add_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - - @distributed_trace_async - async def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List["_models.RaiBlocklistItemBulkRequest"], - **kwargs: Any - ) -> AsyncLROPoller[List["_models.RaiBlocklistItemPropertiesBasicResource"]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. - :type body: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemBulkRequest] - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either list of - RaiBlocklistItemPropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource]] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._add_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_add_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - async def _delete_bulk_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Any, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_delete_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._delete_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - - @distributed_trace_async - async def begin_delete_bulk( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Any, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. - :type body: any - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> "_models.RaiBlocklistItemPropertiesBasicResource": - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistItemPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: "_models.RaiBlocklistItemPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> "_models.RaiBlocklistItemPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistItemPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: "_models.RaiBlocklistItemPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiBlocklistItemPropertiesBasicResource"]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - RaiBlocklistItemPropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py deleted file mode 100644 index 8b845dcaf8f0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_items_operations.py +++ /dev/null @@ -1,146 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_items_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistItemsOperations: - """ConnectionRaiBlocklistItemsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"]: - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_operations.py deleted file mode 100644 index f9938a82b945..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklist_operations.py +++ /dev/null @@ -1,393 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklist_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistOperations: - """ConnectionRaiBlocklistOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> "_models.RaiBlocklistPropertiesBasicResource": - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: "_models.RaiBlocklistPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> "_models.RaiBlocklistPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: "_models.RaiBlocklistPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiBlocklistPropertiesBasicResource"]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiBlocklistPropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklists_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklists_operations.py deleted file mode 100644 index 31794843d7b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_blocklists_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_blocklists_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiBlocklistsOperations: - """ConnectionRaiBlocklistsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"]: - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policies_operations.py deleted file mode 100644 index 0e4e9a3e6200..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policies_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_policies_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiPoliciesOperations: - """ConnectionRaiPoliciesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"]: - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policy_operations.py deleted file mode 100644 index 15c598d3f155..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_connection_rai_policy_operations.py +++ /dev/null @@ -1,393 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._connection_rai_policy_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConnectionRaiPolicyOperations: - """ConnectionRaiPolicyOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiPolicyPropertiesBasicResource"]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiPolicyPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index 9ac05d9d2c6f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataContainersOperations: - """DataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index 0647d9e3f123..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,517 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataVersionsOperations: - """DataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index f1649fd486b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,448 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DatastoresOperations: - """DatastoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.DatastoreResourceArmPaginatedResult"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Datastore": - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Datastore", - skip_validation: Optional[bool] = False, - **kwargs: Any - ) -> "_models.Datastore": - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional["_models.SecretExpiry"] = None, - **kwargs: Any - ) -> "_models.DatastoreSecrets": - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Secret expiry information. - :type body: ~azure.mgmt.machinelearningservices.models.SecretExpiry - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'SecretExpiry') - else: - _json = None - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_deployment_operations.py deleted file mode 100644 index b8518f81ac56..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,584 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_deployment_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_in_workspace_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointDeploymentOperations: - """EndpointDeploymentOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"]: - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.EndpointDeploymentResourcePropertiesBasicResource": - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.EndpointDeploymentResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_operations.py deleted file mode 100644 index 2f2bc42210a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_endpoint_operations.py +++ /dev/null @@ -1,597 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._endpoint_operations import build_create_or_update_request_initial, build_get_models_request, build_get_request, build_list_keys_request, build_list_request, build_regenerate_keys_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EndpointOperations: - """EndpointOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None, - include_online_endpoints: Optional[bool] = False, - include_serverless_endpoints: Optional[bool] = False, - include_connections: Optional[bool] = False, - skip: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"]: - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param include_online_endpoints: - :type include_online_endpoints: bool - :param include_serverless_endpoints: - :type include_serverless_endpoints: bool - :param include_connections: - :type include_connections: bool - :param skip: Continuation token for pagination. - :type skip: str - :param expand: Whether the endpoint resource will be expand to include deployment information, - e.g. $expand=deployments. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_online_endpoints=include_online_endpoints, - include_serverless_endpoints=include_serverless_endpoints, - include_connections=include_connections, - skip=skip, - expand=expand, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_online_endpoints=include_online_endpoints, - include_serverless_endpoints=include_serverless_endpoints, - include_connections=include_connections, - skip=skip, - expand=expand, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointResourcePropertiesBasicResource": - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> Optional["_models.EndpointResourcePropertiesBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.EndpointResourcePropertiesBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointResourcePropertiesBasicResource"]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - EndpointResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointKeys": - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointModels"]: - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateServiceAccountKeyContent", - **kwargs: Any - ) -> "_models.AccountApiKeys": - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index e9ec52b09ce1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentContainersOperations: - """EnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index b527ed077c39..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,508 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EnvironmentVersionsOperations: - """EnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_features_operations.py deleted file mode 100644 index 8bffcc55853d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_features_operations.py +++ /dev/null @@ -1,247 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesOperations: - """FeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 1000, - **kwargs: Any - ) -> AsyncIterable["_models.FeatureResourceArmPaginatedResult"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> "_models.Feature": - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index 12800f5db994..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetContainersOperations: - """FeaturesetContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturesetContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturesetContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index d9f1fa512a56..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,672 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturesetVersionsOperations: - """FeaturesetVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturesetVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - async def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> Optional["_models.FeaturesetVersionBackfillResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace_async - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturesetVersionBackfillRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturesetVersionBackfillResponse"]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturesetVersionBackfillResponse or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 9d2a20ca371e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityContainersOperations: - """FeaturestoreEntityContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace_async - async def get_entity( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.FeaturestoreEntityContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityContainer or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index ed0b53547566..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,526 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FeaturestoreEntityVersionsOperations: - """FeaturestoreEntityVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - page_size: Optional[int] = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.FeaturestoreEntityVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.FeaturestoreEntityVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FeaturestoreEntityVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_endpoints_operations.py deleted file mode 100644 index 8ec34df8c498..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,654 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceEndpointsOperations: - """InferenceEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"]: - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.InferenceEndpoint": - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> Optional["_models.InferenceEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Any, - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> "_models.InferenceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: "_models.InferenceEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceEndpoint"]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_groups_operations.py deleted file mode 100644 index 5a73f5915260..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_groups_operations.py +++ /dev/null @@ -1,1145 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_delta_models_status_async_request, build_get_request, build_get_status_request, build_list_delta_models_async_request, build_list_request, build_list_skus_request, build_modify_delta_models_async_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferenceGroupsOperations: - """InferenceGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"]: - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.InferenceGroup": - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.InferenceGroup"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> "_models.InferenceGroup": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.InferenceGroup", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferenceGroup"]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace_async - async def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.DeltaModelStatusRequest", - **kwargs: Any - ) -> "_models.DeltaModelStatusResponse": - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: DeltaModelBaseRequest. - :type body: ~azure.mgmt.machinelearningservices.models.DeltaModelStatusRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeltaModelStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeltaModelStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeltaModelStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeltaModelStatusRequest') - - request = build_get_delta_models_status_async_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_delta_models_status_async.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeltaModelStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_delta_models_status_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/getStatus"} # type: ignore - - - @distributed_trace - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.DeltaModelListRequest", - **kwargs: Any - ) -> AsyncIterable["_models.StringArmPaginatedResult"]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: DeltaModelBaseRequest. - :type body: ~azure.mgmt.machinelearningservices.models.DeltaModelListRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StringArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.StringArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - cls = kwargs.pop('cls', None) # type: ClsType["_models.StringArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - _json = self._serialize.body(body, 'DeltaModelListRequest') - - request = build_list_delta_models_async_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.list_delta_models_async.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - _json = self._serialize.body(body, 'DeltaModelListRequest') - - request = build_list_delta_models_async_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("StringArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_delta_models_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/list"} # type: ignore - - async def _modify_delta_models_async_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.DeltaModelModifyRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeltaModelModifyRequest') - - request = build_modify_delta_models_async_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._modify_delta_models_async_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _modify_delta_models_async_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/modify"} # type: ignore - - - @distributed_trace_async - async def begin_modify_delta_models_async( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: "_models.DeltaModelModifyRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: DeltaModelModifyRequest. - :type body: ~azure.mgmt.machinelearningservices.models.DeltaModelModifyRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._modify_delta_models_async_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_modify_delta_models_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/modify"} # type: ignore - - @distributed_trace_async - async def get_status( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - **kwargs: Any - ) -> "_models.GroupStatus": - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_pools_operations.py deleted file mode 100644 index 5058d2535880..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_inference_pools_operations.py +++ /dev/null @@ -1,628 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._inference_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InferencePoolsOperations: - """InferencePoolsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.InferencePoolTrackedResourceArmPaginatedResult"]: - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - **kwargs: Any - ) -> "_models.InferencePool": - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.InferencePool"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> "_models.InferencePool": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: "_models.InferencePool", - **kwargs: Any - ) -> AsyncLROPoller["_models.InferencePool"]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InferencePool or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index be8da7381fcd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,540 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - properties: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.JobBaseResourceArmPaginatedResult"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param properties: Comma-separated list of user property names (and optionally values). - Example: prop1,prop2=value2. - :type properties: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> "_models.JobBase": - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.JobBase", - **kwargs: Any - ) -> "_models.JobBase": - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - async def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - - - @distributed_trace_async - async def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 00144528fe7a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkProvisionsOperations: - """ManagedNetworkProvisionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace_async - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedNetworkProvisionStatus"]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 9af993513611..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,458 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagedNetworkSettingsRuleOperations: - """ManagedNetworkSettingsRuleOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.OutboundRuleListResult"]: - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - **kwargs: Any - ) -> "_models.OutboundRuleBasicResource": - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OutboundRuleBasicResource"]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OutboundRuleBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index a48a88561567..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._marketplace_subscriptions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MarketplaceSubscriptionsOperations: - """MarketplaceSubscriptionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> "_models.MarketplaceSubscription": - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.MarketplaceSubscription", - **kwargs: Any - ) -> AsyncLROPoller["_models.MarketplaceSubscription"]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either MarketplaceSubscription or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index ad38921e54e6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,349 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelContainersOperations: - """ModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 3892100c6359..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,540 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_publish_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ModelVersionsOperations: - """ModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - async def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace_async - async def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.DestinationAsset", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index e235c5fec3c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineDeploymentsOperations: - """OnlineDeploymentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - **kwargs: Any - ) -> "_models.OnlineDeployment": - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.PartialMinimalTrackedResourceWithSku", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.OnlineDeployment", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineDeployment"]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: "_models.DeploymentLogsRequest", - **kwargs: Any - ) -> "_models.DeploymentLogs": - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeploymentLogs, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SkuResourceArmPaginatedResult"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index efa6d284239a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,897 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OnlineEndpointsOperations: - """OnlineEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, "_models.OrderString"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.OnlineEndpoint": - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.PartialMinimalTrackedResourceWithIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.OnlineEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.OnlineEndpoint"]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - @distributed_trace_async - async def get_token( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - **kwargs: Any - ) -> "_models.EndpointAuthToken": - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthToken, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_operations.py deleted file mode 100644 index c088e1bd2fe4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index e613d4b41043..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,332 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> None: - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: "_models.PrivateEndpointConnection", - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 120775a3d750..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,143 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_ptu_quota_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_ptu_quota_operations.py deleted file mode 100644 index 116364e197a7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_ptu_quota_operations.py +++ /dev/null @@ -1,275 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._ptu_quota_operations import build_get_available_request, build_list_available_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PTUQuotaOperations: - """PTUQuotaOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_available( - self, - location: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AvailableQuotaArmPaginatedResult"]: - """List available MaaS PTU quota. - - List available MaaS PTU quota. - - :param location: The name of Azure region. - :type location: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AvailableQuotaArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AvailableQuotaArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableQuotaArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_available_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=self.list_available.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_available_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AvailableQuotaArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_available.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota"} # type: ignore - - @distributed_trace_async - async def get_available( - self, - location: str, - **kwargs: Any - ) -> "_models.AvailableQuota": - """Get available MaaS PTU quota. - - Get available MaaS PTU quota. - - :param location: The name of Azure region. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AvailableQuota, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AvailableQuota - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableQuota"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_available_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.get_available.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AvailableQuota', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_available.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota/default"} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.UsageAndQuotaDetailsArmPaginatedResult"]: - """List MaaS PTU usage and quota. - - List MaaS PTU usage and quota. - - :param location: The name of Azure region. - :type location: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UsageAndQuotaDetailsArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.UsageAndQuotaDetailsArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageAndQuotaDetailsArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("UsageAndQuotaDetailsArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotaAndUsage"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index d222a4c55c7b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,186 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class QuotasOperations: - """QuotasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def update( - self, - location: str, - parameters: "_models.QuotaUpdateParameters", - **kwargs: Any - ) -> "_models.UpdateWorkspaceQuotasResult": - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateWorkspaceQuotasResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policies_operations.py deleted file mode 100644 index 5725269d15d8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policies_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._rai_policies_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RaiPoliciesOperations: - """RaiPoliciesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"]: - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policy_operations.py deleted file mode 100644 index 6e42a201130e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_rai_policy_operations.py +++ /dev/null @@ -1,393 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._rai_policy_operations import build_create_request_initial, build_delete_request_initial, build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RaiPolicyOperations: - """RaiPolicyOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> "_models.RaiPolicyPropertiesBasicResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: "_models.RaiPolicyPropertiesBasicResource", - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.RaiPolicyPropertiesBasicResource"]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RaiPolicyPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index d55d93be38bd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,710 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistriesOperations: - """RegistriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any - ) -> "_models.Registry": - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> "_models.Registry": - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - async def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace_async - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: "_models.Registry", - **kwargs: Any - ) -> AsyncLROPoller["_models.Registry"]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Registry or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index 54021f3b32ed..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeContainersOperations: - """RegistryCodeContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - **kwargs: Any - ) -> "_models.CodeContainer": - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: "_models.CodeContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeContainer"]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index 8c339aa35351..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryCodeVersionsOperations: - """RegistryCodeVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.CodeVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - **kwargs: Any - ) -> "_models.CodeVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.CodeVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.CodeVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 36b3502e6b38..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentContainersOperations: - """RegistryComponentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - **kwargs: Any - ) -> "_models.ComponentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: "_models.ComponentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index ae8d31c2e272..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,494 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryComponentVersionsOperations: - """RegistryComponentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - **kwargs: Any - ) -> "_models.ComponentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: "_models.ComponentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComponentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index e944e1a7971a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataContainersOperations: - """RegistryDataContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataContainerResourceArmPaginatedResult"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - **kwargs: Any - ) -> "_models.DataContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: "_models.DataContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_references_operations.py deleted file mode 100644 index d2c68838a68e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,120 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_references_operations import build_get_blob_reference_sas_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataReferencesOperations: - """RegistryDataReferencesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.GetBlobReferenceSASRequestDto", - **kwargs: Any - ) -> "_models.GetBlobReferenceSASResponseDto": - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index 8a0e30e35404..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,584 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryDataVersionsOperations: - """RegistryDataVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataVersionBaseResourceArmPaginatedResult"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - **kwargs: Any - ) -> "_models.DataVersionBase": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.DataVersionBase", - **kwargs: Any - ) -> AsyncLROPoller["_models.DataVersionBase"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 034be3dff8f2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentContainersOperations: - """RegistryEnvironmentContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - **kwargs: Any - ) -> "_models.EnvironmentContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: "_models.EnvironmentContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentContainer"]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index d45b3d18ed54..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryEnvironmentVersionsOperations: - """RegistryEnvironmentVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - **kwargs: Any - ) -> "_models.EnvironmentVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: "_models.EnvironmentVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.EnvironmentVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index 5f8212491e90..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,468 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelContainersOperations: - """RegistryModelContainersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelContainerResourceArmPaginatedResult"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - **kwargs: Any - ) -> "_models.ModelContainer": - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: "_models.ModelContainer", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelContainer"]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index 8731bc3128d3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,597 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RegistryModelVersionsOperations: - """RegistryModelVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ModelVersionResourceArmPaginatedResult"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - **kwargs: Any - ) -> "_models.ModelVersion": - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.ModelVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.ModelVersion"]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PendingUploadRequestDto", - **kwargs: Any - ) -> "_models.PendingUploadResponseDto": - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index 688d13ea16b0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_schedules_operations.py +++ /dev/null @@ -1,467 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SchedulesOperations: - """SchedulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.Schedule": - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Schedule, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Schedule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.Schedule", - **kwargs: Any - ) -> AsyncLROPoller["_models.Schedule"]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Schedule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 4335728c6694..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,810 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._serverless_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ServerlessEndpointsOperations: - """ServerlessEndpointsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"]: - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> Optional["_models.ServerlessEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> "_models.ServerlessEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.ServerlessEndpoint", - **kwargs: Any - ) -> AsyncLROPoller["_models.ServerlessEndpoint"]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - **kwargs: Any - ) -> "_models.EndpointAuthKeys": - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> Optional["_models.EndpointAuthKeys"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: "_models.RegenerateEndpointKeysRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.EndpointAuthKeys"]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 37a6473d7b05..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListUsagesResult"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListUsagesResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 58f290c92ff9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualMachineSizesOperations: - """VirtualMachineSizesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - location: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index 7d870cc3ff04..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,624 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request, build_test_connection_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceConnectionsOperations: - """WorkspaceConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: Optional[bool] = False, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> None: - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionUpdateParameter"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - async def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace_async - async def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 2450fc1054fb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspace_features_operations.py +++ /dev/null @@ -1,129 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceFeaturesOperations: - """WorkspaceFeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListAmlUserFeatureResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index 8ae1f37842e1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1357 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: - """WorkspacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - force_to_purge: Optional[bool] = False, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.Workspace": - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.Workspace", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.DiagnoseResponseResult"]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiagnoseResponseResult or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListWorkspaceKeysResult": - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListWorkspaceKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace_async - async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.NotebookAccessTokenResult": - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NotebookAccessTokenResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace_async - async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListNotebookKeysResult": - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListNotebookKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace_async - async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListStorageAccountKeysResult": - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListStorageAccountKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ExternalFQDNResponse": - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalFQDNResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace_async - async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace_async - async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/__init__.py deleted file mode 100644 index 8053fa83c0bb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/__init__.py +++ /dev/null @@ -1,2300 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AADAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AKS - from ._models_py3 import AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountApiKeys - from ._models_py3 import AccountKeyAuthTypeWorkspaceConnectionProperties - from ._models_py3 import AccountKeyDatastoreCredentials - from ._models_py3 import AccountKeyDatastoreSecrets - from ._models_py3 import AcrDetails - from ._models_py3 import ActualCapacityInfo - from ._models_py3 import AksComputeSecrets - from ._models_py3 import AksComputeSecretsProperties - from ._models_py3 import AksNetworkingConfiguration - from ._models_py3 import AllFeatures - from ._models_py3 import AllNodes - from ._models_py3 import AmlCompute - from ._models_py3 import AmlComputeNodeInformation - from ._models_py3 import AmlComputeNodesInformation - from ._models_py3 import AmlComputeProperties - from ._models_py3 import AmlComputeSchema - from ._models_py3 import AmlToken - from ._models_py3 import AmlTokenComputeIdentity - from ._models_py3 import AmlUserFeature - from ._models_py3 import AnonymousAccessCredential - from ._models_py3 import ApiKeyAuthWorkspaceConnectionProperties - from ._models_py3 import ArmResourceId - from ._models_py3 import AssetBase - from ._models_py3 import AssetContainer - from ._models_py3 import AssetJobInput - from ._models_py3 import AssetJobOutput - from ._models_py3 import AssetReferenceBase - from ._models_py3 import AssignedUser - from ._models_py3 import AutoForecastHorizon - from ._models_py3 import AutoMLJob - from ._models_py3 import AutoMLVertical - from ._models_py3 import AutoNCrossValidations - from ._models_py3 import AutoPauseProperties - from ._models_py3 import AutoScaleProperties - from ._models_py3 import AutoSeasonality - from ._models_py3 import AutoTargetLags - from ._models_py3 import AutoTargetRollingWindowSize - from ._models_py3 import AvailableQuota - from ._models_py3 import AvailableQuotaArmPaginatedResult - from ._models_py3 import AvailableQuotaProperties - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureDevOpsWebhook - from ._models_py3 import AzureFileDatastore - from ._models_py3 import AzureOpenAiFineTuning - from ._models_py3 import AzureOpenAiHyperParameters - from ._models_py3 import BanditPolicy - from ._models_py3 import BatchDeployment - from ._models_py3 import BatchDeploymentConfiguration - from ._models_py3 import BatchDeploymentProperties - from ._models_py3 import BatchDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import BatchEndpoint - from ._models_py3 import BatchEndpointDefaults - from ._models_py3 import BatchEndpointProperties - from ._models_py3 import BatchEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import BatchPipelineComponentDeploymentConfiguration - from ._models_py3 import BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BlobReferenceForConsumptionDto - from ._models_py3 import BuildContext - from ._models_py3 import CapabilityHost - from ._models_py3 import CapabilityHostProperties - from ._models_py3 import CapacityConfig - from ._models_py3 import CategoricalDataDriftMetricThreshold - from ._models_py3 import CategoricalDataQualityMetricThreshold - from ._models_py3 import CategoricalPredictionDriftMetricThreshold - from ._models_py3 import CertificateDatastoreCredentials - from ._models_py3 import CertificateDatastoreSecrets - from ._models_py3 import Classification - from ._models_py3 import ClassificationTrainingSettings - from ._models_py3 import ClusterUpdateParameters - from ._models_py3 import CodeConfiguration - from ._models_py3 import CodeContainer - from ._models_py3 import CodeContainerProperties - from ._models_py3 import CodeContainerResourceArmPaginatedResult - from ._models_py3 import CodeVersion - from ._models_py3 import CodeVersionProperties - from ._models_py3 import CodeVersionResourceArmPaginatedResult - from ._models_py3 import CognitiveServiceEndpointDeploymentResourceProperties - from ._models_py3 import CognitiveServicesSku - from ._models_py3 import Collection - from ._models_py3 import ColumnTransformer - from ._models_py3 import CommandJob - from ._models_py3 import CommandJobLimits - from ._models_py3 import ComponentContainer - from ._models_py3 import ComponentContainerProperties - from ._models_py3 import ComponentContainerResourceArmPaginatedResult - from ._models_py3 import ComponentVersion - from ._models_py3 import ComponentVersionProperties - from ._models_py3 import ComponentVersionResourceArmPaginatedResult - from ._models_py3 import Compute - from ._models_py3 import ComputeInstance - from ._models_py3 import ComputeInstanceApplication - from ._models_py3 import ComputeInstanceAutologgerSettings - from ._models_py3 import ComputeInstanceConnectivityEndpoints - from ._models_py3 import ComputeInstanceContainer - from ._models_py3 import ComputeInstanceCreatedBy - from ._models_py3 import ComputeInstanceDataDisk - from ._models_py3 import ComputeInstanceDataMount - from ._models_py3 import ComputeInstanceEnvironmentInfo - from ._models_py3 import ComputeInstanceLastOperation - from ._models_py3 import ComputeInstanceProperties - from ._models_py3 import ComputeInstanceSchema - from ._models_py3 import ComputeInstanceSshSettings - from ._models_py3 import ComputeInstanceVersion - from ._models_py3 import ComputeRecurrenceSchedule - from ._models_py3 import ComputeResource - from ._models_py3 import ComputeResourceSchema - from ._models_py3 import ComputeRuntimeDto - from ._models_py3 import ComputeSchedules - from ._models_py3 import ComputeSecrets - from ._models_py3 import ComputeStartStopSchedule - from ._models_py3 import ContainerResourceRequirements - from ._models_py3 import ContainerResourceSettings - from ._models_py3 import ContentSafety - from ._models_py3 import ContentSafetyEndpointDeploymentResourceProperties - from ._models_py3 import ContentSafetyEndpointResourceProperties - from ._models_py3 import CosmosDbSettings - from ._models_py3 import CreateMonitorAction - from ._models_py3 import Cron - from ._models_py3 import CronTrigger - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomKeys - from ._models_py3 import CustomKeysWorkspaceConnectionProperties - from ._models_py3 import CustomMetricThreshold - from ._models_py3 import CustomModelFineTuning - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - from ._models_py3 import CustomMonitoringSignal - from ._models_py3 import CustomNCrossValidations - from ._models_py3 import CustomSeasonality - from ._models_py3 import CustomService - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataCollector - from ._models_py3 import DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - from ._models_py3 import DataDriftMetricThresholdBase - from ._models_py3 import DataDriftMonitoringSignal - from ._models_py3 import DataFactory - from ._models_py3 import DataGenerationVertical - from ._models_py3 import DataLakeAnalytics - from ._models_py3 import DataLakeAnalyticsSchema - from ._models_py3 import DataLakeAnalyticsSchemaProperties - from ._models_py3 import DataPathAssetReference - from ._models_py3 import DataQualityMetricThresholdBase - from ._models_py3 import DataQualityMonitoringSignal - from ._models_py3 import DataReferenceCredential - from ._models_py3 import DataVersionBase - from ._models_py3 import DataVersionBaseProperties - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import Databricks - from ._models_py3 import DatabricksComputeSecrets - from ._models_py3 import DatabricksComputeSecretsProperties - from ._models_py3 import DatabricksProperties - from ._models_py3 import DatabricksSchema - from ._models_py3 import Datastore - from ._models_py3 import DatastoreCredentials - from ._models_py3 import DatastoreProperties - from ._models_py3 import DatastoreResourceArmPaginatedResult - from ._models_py3 import DatastoreSecrets - from ._models_py3 import DefaultScaleSettings - from ._models_py3 import DeltaModelCurrentState - from ._models_py3 import DeltaModelListRequest - from ._models_py3 import DeltaModelModifyRequest - from ._models_py3 import DeltaModelStatusRequest - from ._models_py3 import DeltaModelStatusResponse - from ._models_py3 import DeploymentLogs - from ._models_py3 import DeploymentLogsRequest - from ._models_py3 import DeploymentResourceConfiguration - from ._models_py3 import DestinationAsset - from ._models_py3 import DiagnoseRequestProperties - from ._models_py3 import DiagnoseResponseResult - from ._models_py3 import DiagnoseResponseResultValue - from ._models_py3 import DiagnoseResult - from ._models_py3 import DiagnoseWorkspaceParameters - from ._models_py3 import DistillationJob - from ._models_py3 import DistributionConfiguration - from ._models_py3 import Docker - from ._models_py3 import DockerCredential - from ._models_py3 import EarlyTerminationPolicy - from ._models_py3 import EncryptionKeyVaultUpdateProperties - from ._models_py3 import EncryptionProperty - from ._models_py3 import EncryptionUpdateProperties - from ._models_py3 import Endpoint - from ._models_py3 import EndpointAuthKeys - from ._models_py3 import EndpointAuthToken - from ._models_py3 import EndpointDeploymentModel - from ._models_py3 import EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointDeploymentResourceProperties - from ._models_py3 import EndpointDeploymentResourcePropertiesBasicResource - from ._models_py3 import EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult - from ._models_py3 import EndpointKeys - from ._models_py3 import EndpointModelDeprecationProperties - from ._models_py3 import EndpointModelProperties - from ._models_py3 import EndpointModelSkuCapacityProperties - from ._models_py3 import EndpointModelSkuProperties - from ._models_py3 import EndpointModelSkuRateLimitProperties - from ._models_py3 import EndpointModelSkuRateLimitRulePatternProperties - from ._models_py3 import EndpointModelSkuRateLimitRuleProperties - from ._models_py3 import EndpointModels - from ._models_py3 import EndpointPropertiesBase - from ._models_py3 import EndpointResourceProperties - from ._models_py3 import EndpointResourcePropertiesBasicResource - from ._models_py3 import EndpointResourcePropertiesBasicResourceArmPaginatedResult - from ._models_py3 import EndpointScheduleAction - from ._models_py3 import EnvironmentContainer - from ._models_py3 import EnvironmentContainerProperties - from ._models_py3 import EnvironmentContainerResourceArmPaginatedResult - from ._models_py3 import EnvironmentVariable - from ._models_py3 import EnvironmentVersion - from ._models_py3 import EnvironmentVersionProperties - from ._models_py3 import EnvironmentVersionResourceArmPaginatedResult - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import EstimatedVMPrice - from ._models_py3 import EstimatedVMPrices - from ._models_py3 import ExternalFQDNResponse - from ._models_py3 import FQDNEndpoint - from ._models_py3 import FQDNEndpointDetail - from ._models_py3 import FQDNEndpoints - from ._models_py3 import FQDNEndpointsPropertyBag - from ._models_py3 import Feature - from ._models_py3 import FeatureAttributionDriftMonitoringSignal - from ._models_py3 import FeatureAttributionMetricThreshold - from ._models_py3 import FeatureImportanceSettings - from ._models_py3 import FeatureProperties - from ._models_py3 import FeatureResourceArmPaginatedResult - from ._models_py3 import FeatureStoreSettings - from ._models_py3 import FeatureSubset - from ._models_py3 import FeatureWindow - from ._models_py3 import FeaturesetContainer - from ._models_py3 import FeaturesetContainerProperties - from ._models_py3 import FeaturesetContainerResourceArmPaginatedResult - from ._models_py3 import FeaturesetSpecification - from ._models_py3 import FeaturesetVersion - from ._models_py3 import FeaturesetVersionBackfillRequest - from ._models_py3 import FeaturesetVersionBackfillResponse - from ._models_py3 import FeaturesetVersionProperties - from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityContainer - from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult - from ._models_py3 import FeaturestoreEntityVersion - from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult - from ._models_py3 import FeaturizationSettings - from ._models_py3 import FineTuningJob - from ._models_py3 import FineTuningVertical - from ._models_py3 import FinetuningDetails - from ._models_py3 import FixedInputData - from ._models_py3 import FlavorData - from ._models_py3 import ForecastHorizon - from ._models_py3 import Forecasting - from ._models_py3 import ForecastingSettings - from ._models_py3 import ForecastingTrainingSettings - from ._models_py3 import FqdnOutboundRule - from ._models_py3 import GetBlobReferenceForConsumptionDto - from ._models_py3 import GetBlobReferenceSASRequestDto - from ._models_py3 import GetBlobReferenceSASResponseDto - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import GroupEnvironmentConfiguration - from ._models_py3 import GroupModelConfiguration - from ._models_py3 import GroupStatus - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import IPRule - from ._models_py3 import IdAssetReference - from ._models_py3 import IdentityConfiguration - from ._models_py3 import IdentityForCmk - from ._models_py3 import IdleShutdownSetting - from ._models_py3 import Image - from ._models_py3 import ImageClassification - from ._models_py3 import ImageClassificationBase - from ._models_py3 import ImageClassificationMultilabel - from ._models_py3 import ImageDetails - from ._models_py3 import ImageInfo - from ._models_py3 import ImageInstanceSegmentation - from ._models_py3 import ImageLimitSettings - from ._models_py3 import ImageMetadata - from ._models_py3 import ImageModelDistributionSettings - from ._models_py3 import ImageModelDistributionSettingsClassification - from ._models_py3 import ImageModelDistributionSettingsObjectDetection - from ._models_py3 import ImageModelSettings - from ._models_py3 import ImageModelSettingsClassification - from ._models_py3 import ImageModelSettingsObjectDetection - from ._models_py3 import ImageObjectDetection - from ._models_py3 import ImageObjectDetectionBase - from ._models_py3 import ImageSweepSettings - from ._models_py3 import ImageVertical - from ._models_py3 import IndexColumn - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import InferenceEndpoint - from ._models_py3 import InferenceEndpointProperties - from ._models_py3 import InferenceEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import InferenceGroup - from ._models_py3 import InferenceGroupProperties - from ._models_py3 import InferenceGroupTrackedResourceArmPaginatedResult - from ._models_py3 import InferencePool - from ._models_py3 import InferencePoolProperties - from ._models_py3 import InferencePoolTrackedResourceArmPaginatedResult - from ._models_py3 import InstanceTypeSchema - from ._models_py3 import InstanceTypeSchemaResources - from ._models_py3 import JobBase - from ._models_py3 import JobBaseProperties - from ._models_py3 import JobBaseResourceArmPaginatedResult - from ._models_py3 import JobInput - from ._models_py3 import JobLimits - from ._models_py3 import JobOutput - from ._models_py3 import JobResourceConfiguration - from ._models_py3 import JobResources - from ._models_py3 import JobScheduleAction - from ._models_py3 import JobService - from ._models_py3 import JupyterKernelConfig - from ._models_py3 import KeyVaultProperties - from ._models_py3 import Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LabelGeneration - from ._models_py3 import LakeHouseArtifact - from ._models_py3 import ListAmlUserFeatureResult - from ._models_py3 import ListNotebookKeysResult - from ._models_py3 import ListStorageAccountKeysResult - from ._models_py3 import ListUsagesResult - from ._models_py3 import ListWorkspaceKeysResult - from ._models_py3 import ListWorkspaceQuotas - from ._models_py3 import LiteralJobInput - from ._models_py3 import MLFlowModelJobInput - from ._models_py3 import MLFlowModelJobOutput - from ._models_py3 import MLTableData - from ._models_py3 import MLTableJobInput - from ._models_py3 import MLTableJobOutput - from ._models_py3 import ManagedComputeIdentity - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedIdentityCredential - from ._models_py3 import ManagedNetworkProvisionOptions - from ._models_py3 import ManagedNetworkProvisionStatus - from ._models_py3 import ManagedNetworkSettings - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedOnlineEndpointDeploymentResourceProperties - from ._models_py3 import ManagedOnlineEndpointResourceProperties - from ._models_py3 import ManagedResourceGroupAssignedIdentities - from ._models_py3 import ManagedResourceGroupSettings - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MarketplacePlan - from ._models_py3 import MarketplaceSubscription - from ._models_py3 import MarketplaceSubscriptionProperties - from ._models_py3 import MarketplaceSubscriptionResourceArmPaginatedResult - from ._models_py3 import MaterializationComputeResource - from ._models_py3 import MaterializationSettings - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelSettings - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import MonitorComputeConfigurationBase - from ._models_py3 import MonitorComputeIdentityBase - from ._models_py3 import MonitorDefinition - from ._models_py3 import MonitorEmailNotificationSettings - from ._models_py3 import MonitorNotificationSettings - from ._models_py3 import MonitorServerlessSparkCompute - from ._models_py3 import MonitoringFeatureFilterBase - from ._models_py3 import MonitoringInputDataBase - from ._models_py3 import MonitoringSignalBase - from ._models_py3 import MonitoringTarget - from ._models_py3 import MonitoringThreshold - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NetworkAcls - from ._models_py3 import NlpVertical - from ._models_py3 import NlpVerticalFeaturizationSettings - from ._models_py3 import NlpVerticalLimitSettings - from ._models_py3 import NodeStateCounts - from ._models_py3 import Nodes - from ._models_py3 import NoneAuthTypeWorkspaceConnectionProperties - from ._models_py3 import NoneDatastoreCredentials - from ._models_py3 import NotebookAccessTokenResult - from ._models_py3 import NotebookPreparationError - from ._models_py3 import NotebookResourceInfo - from ._models_py3 import NotificationSetting - from ._models_py3 import NumericalDataDriftMetricThreshold - from ._models_py3 import NumericalDataQualityMetricThreshold - from ._models_py3 import NumericalPredictionDriftMetricThreshold - from ._models_py3 import OAuth2AuthTypeWorkspaceConnectionProperties - from ._models_py3 import Objective - from ._models_py3 import OneLakeArtifact - from ._models_py3 import OneLakeDatastore - from ._models_py3 import OnlineDeployment - from ._models_py3 import OnlineDeploymentProperties - from ._models_py3 import OnlineDeploymentTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineEndpoint - from ._models_py3 import OnlineEndpointProperties - from ._models_py3 import OnlineEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import OpenAIEndpointDeploymentResourceProperties - from ._models_py3 import OpenAIEndpointResourceProperties - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import OsPatchingStatus - from ._models_py3 import OutboundRule - from ._models_py3 import OutboundRuleBasicResource - from ._models_py3 import OutboundRuleListResult - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties - from ._models_py3 import PTUDeploymentUsage - from ._models_py3 import PackageDetails - from ._models_py3 import PaginatedComputeResourcesList - from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - from ._models_py3 import PartialManagedServiceIdentity - from ._models_py3 import PartialMinimalTrackedResource - from ._models_py3 import PartialMinimalTrackedResourceWithIdentity - from ._models_py3 import PartialMinimalTrackedResourceWithSku - from ._models_py3 import PartialMinimalTrackedResourceWithSkuAndIdentity - from ._models_py3 import PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PendingUploadCredentialDto - from ._models_py3 import PendingUploadRequestDto - from ._models_py3 import PendingUploadResponseDto - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - from ._models_py3 import PredictionDriftMetricThresholdBase - from ._models_py3 import PredictionDriftMonitoringSignal - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateEndpointDestination - from ._models_py3 import PrivateEndpointOutboundRule - from ._models_py3 import PrivateEndpointResource - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import ProbeSettings - from ._models_py3 import PromptSettings - from ._models_py3 import PropertiesBase - from ._models_py3 import ProxyResource - from ._models_py3 import PyTorch - from ._models_py3 import QueueSettings - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RaiBlocklistConfig - from ._models_py3 import RaiBlocklistItemBulkRequest - from ._models_py3 import RaiBlocklistItemProperties - from ._models_py3 import RaiBlocklistItemPropertiesBasicResource - from ._models_py3 import RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RaiBlocklistProperties - from ._models_py3 import RaiBlocklistPropertiesBasicResource - from ._models_py3 import RaiBlocklistPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RaiPolicyContentFilter - from ._models_py3 import RaiPolicyProperties - from ._models_py3 import RaiPolicyPropertiesBasicResource - from ._models_py3 import RaiPolicyPropertiesBasicResourceArmPaginatedResult - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import Recurrence - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import RegenerateServiceAccountKeyContent - from ._models_py3 import Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryPartialManagedServiceIdentity - from ._models_py3 import RegistryPrivateEndpointConnection - from ._models_py3 import RegistryPrivateLinkServiceConnectionState - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionTrainingSettings - from ._models_py3 import RequestConfiguration - from ._models_py3 import RequestLogging - from ._models_py3 import ResizeSchema - from ._models_py3 import Resource - from ._models_py3 import ResourceBase - from ._models_py3 import ResourceConfiguration - from ._models_py3 import ResourceId - from ._models_py3 import ResourceName - from ._models_py3 import ResourceQuota - from ._models_py3 import RollingInputData - from ._models_py3 import Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - from ._models_py3 import SASCredential - from ._models_py3 import SASCredentialDto - from ._models_py3 import SamplingAlgorithm - from ._models_py3 import SasDatastoreCredentials - from ._models_py3 import SasDatastoreSecrets - from ._models_py3 import ScaleSettings - from ._models_py3 import ScaleSettingsInformation - from ._models_py3 import ScaleUnitConfiguration - from ._models_py3 import Schedule - from ._models_py3 import ScheduleActionBase - from ._models_py3 import ScheduleBase - from ._models_py3 import ScheduleProperties - from ._models_py3 import ScheduleResourceArmPaginatedResult - from ._models_py3 import ScriptReference - from ._models_py3 import ScriptsToExecute - from ._models_py3 import Seasonality - from ._models_py3 import SecretExpiry - from ._models_py3 import ServerlessComputeSettings - from ._models_py3 import ServerlessEndpoint - from ._models_py3 import ServerlessEndpointCapacityReservation - from ._models_py3 import ServerlessEndpointContentSafety - from ._models_py3 import ServerlessEndpointInferenceEndpoint - from ._models_py3 import ServerlessEndpointModelSettings - from ._models_py3 import ServerlessEndpointProperties - from ._models_py3 import ServerlessEndpointResourceProperties - from ._models_py3 import ServerlessEndpointTrackedResourceArmPaginatedResult - from ._models_py3 import ServerlessInferenceEndpoint - from ._models_py3 import ServerlessOffer - from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - from ._models_py3 import ServiceTagDestination - from ._models_py3 import ServiceTagOutboundRule - from ._models_py3 import SetupScripts - from ._models_py3 import SharedPrivateLinkResource - from ._models_py3 import Sku - from ._models_py3 import SkuCapacity - from ._models_py3 import SkuResource - from ._models_py3 import SkuResourceArmPaginatedResult - from ._models_py3 import SkuSetting - from ._models_py3 import SparkJob - from ._models_py3 import SparkJobEntry - from ._models_py3 import SparkJobPythonEntry - from ._models_py3 import SparkJobScalaEntry - from ._models_py3 import SparkResourceConfiguration - from ._models_py3 import SpeechEndpointDeploymentResourceProperties - from ._models_py3 import SpeechEndpointResourceProperties - from ._models_py3 import SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StaticInputData - from ._models_py3 import StorageAccountDetails - from ._models_py3 import StringArmPaginatedResult - from ._models_py3 import StringKeyValuePair - from ._models_py3 import SweepJob - from ._models_py3 import SweepJobLimits - from ._models_py3 import SynapseSpark - from ._models_py3 import SynapseSparkProperties - from ._models_py3 import SystemCreatedAcrAccount - from ._models_py3 import SystemCreatedStorageAccount - from ._models_py3 import SystemData - from ._models_py3 import SystemService - from ._models_py3 import TableVertical - from ._models_py3 import TableVerticalFeaturizationSettings - from ._models_py3 import TableVerticalLimitSettings - from ._models_py3 import TargetLags - from ._models_py3 import TargetRollingWindowSize - from ._models_py3 import TargetUtilizationScaleSettings - from ._models_py3 import TeacherModelEndpoint - from ._models_py3 import TeacherModelEndpointRequestSettings - from ._models_py3 import TeacherModelSettings - from ._models_py3 import TensorFlow - from ._models_py3 import TextClassification - from ._models_py3 import TextClassificationMultilabel - from ._models_py3 import TextNer - from ._models_py3 import TmpfsOptions - from ._models_py3 import TopNFeaturesByAttribution - from ._models_py3 import TrackedResource - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TriggerBase - from ._models_py3 import TritonModelJobInput - from ._models_py3 import TritonModelJobOutput - from ._models_py3 import TruncationSelectionPolicy - from ._models_py3 import UpdateWorkspaceQuotas - from ._models_py3 import UpdateWorkspaceQuotasResult - from ._models_py3 import UriFileDataVersion - from ._models_py3 import UriFileJobInput - from ._models_py3 import UriFileJobOutput - from ._models_py3 import UriFolderDataVersion - from ._models_py3 import UriFolderJobInput - from ._models_py3 import UriFolderJobOutput - from ._models_py3 import Usage - from ._models_py3 import UsageAndQuotaDetails - from ._models_py3 import UsageAndQuotaDetailsArmPaginatedResult - from ._models_py3 import UsageName - from ._models_py3 import UserAccountCredentials - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import UserCreatedAcrAccount - from ._models_py3 import UserCreatedStorageAccount - from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties - from ._models_py3 import VirtualMachine - from ._models_py3 import VirtualMachineImage - from ._models_py3 import VirtualMachineSchema - from ._models_py3 import VirtualMachineSchemaProperties - from ._models_py3 import VirtualMachineSecrets - from ._models_py3 import VirtualMachineSecretsSchema - from ._models_py3 import VirtualMachineSize - from ._models_py3 import VirtualMachineSizeListResult - from ._models_py3 import VirtualMachineSshCredentials - from ._models_py3 import VolumeDefinition - from ._models_py3 import VolumeOptions - from ._models_py3 import VulnerabilityDetails - from ._models_py3 import VulnerabilityFindings - from ._models_py3 import Webhook - from ._models_py3 import Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionAccountKey - from ._models_py3 import WorkspaceConnectionApiKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - from ._models_py3 import WorkspaceConnectionOAuth2 - from ._models_py3 import WorkspaceConnectionPersonalAccessToken - from ._models_py3 import WorkspaceConnectionPropertiesV2 - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult - from ._models_py3 import WorkspaceConnectionServicePrincipal - from ._models_py3 import WorkspaceConnectionSharedAccessSignature - from ._models_py3 import WorkspaceConnectionUpdateParameter - from ._models_py3 import WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceHubConfig - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspacePrivateEndpointResource - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - from ._models import AADAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AKS # type: ignore - from ._models import AKSSchema # type: ignore - from ._models import AKSSchemaProperties # type: ignore - from ._models import AccessKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountApiKeys # type: ignore - from ._models import AccountKeyAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import AccountKeyDatastoreCredentials # type: ignore - from ._models import AccountKeyDatastoreSecrets # type: ignore - from ._models import AcrDetails # type: ignore - from ._models import ActualCapacityInfo # type: ignore - from ._models import AksComputeSecrets # type: ignore - from ._models import AksComputeSecretsProperties # type: ignore - from ._models import AksNetworkingConfiguration # type: ignore - from ._models import AllFeatures # type: ignore - from ._models import AllNodes # type: ignore - from ._models import AmlCompute # type: ignore - from ._models import AmlComputeNodeInformation # type: ignore - from ._models import AmlComputeNodesInformation # type: ignore - from ._models import AmlComputeProperties # type: ignore - from ._models import AmlComputeSchema # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlTokenComputeIdentity # type: ignore - from ._models import AmlUserFeature # type: ignore - from ._models import AnonymousAccessCredential # type: ignore - from ._models import ApiKeyAuthWorkspaceConnectionProperties # type: ignore - from ._models import ArmResourceId # type: ignore - from ._models import AssetBase # type: ignore - from ._models import AssetContainer # type: ignore - from ._models import AssetJobInput # type: ignore - from ._models import AssetJobOutput # type: ignore - from ._models import AssetReferenceBase # type: ignore - from ._models import AssignedUser # type: ignore - from ._models import AutoForecastHorizon # type: ignore - from ._models import AutoMLJob # type: ignore - from ._models import AutoMLVertical # type: ignore - from ._models import AutoNCrossValidations # type: ignore - from ._models import AutoPauseProperties # type: ignore - from ._models import AutoScaleProperties # type: ignore - from ._models import AutoSeasonality # type: ignore - from ._models import AutoTargetLags # type: ignore - from ._models import AutoTargetRollingWindowSize # type: ignore - from ._models import AvailableQuota # type: ignore - from ._models import AvailableQuotaArmPaginatedResult # type: ignore - from ._models import AvailableQuotaProperties # type: ignore - from ._models import AzureBlobDatastore # type: ignore - from ._models import AzureDataLakeGen1Datastore # type: ignore - from ._models import AzureDataLakeGen2Datastore # type: ignore - from ._models import AzureDatastore # type: ignore - from ._models import AzureDevOpsWebhook # type: ignore - from ._models import AzureFileDatastore # type: ignore - from ._models import AzureOpenAiFineTuning # type: ignore - from ._models import AzureOpenAiHyperParameters # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BatchDeployment # type: ignore - from ._models import BatchDeploymentConfiguration # type: ignore - from ._models import BatchDeploymentProperties # type: ignore - from ._models import BatchDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchEndpoint # type: ignore - from ._models import BatchEndpointDefaults # type: ignore - from ._models import BatchEndpointProperties # type: ignore - from ._models import BatchEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import BatchPipelineComponentDeploymentConfiguration # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # type: ignore - from ._models import BlobReferenceForConsumptionDto # type: ignore - from ._models import BuildContext # type: ignore - from ._models import CapabilityHost # type: ignore - from ._models import CapabilityHostProperties # type: ignore - from ._models import CapacityConfig # type: ignore - from ._models import CategoricalDataDriftMetricThreshold # type: ignore - from ._models import CategoricalDataQualityMetricThreshold # type: ignore - from ._models import CategoricalPredictionDriftMetricThreshold # type: ignore - from ._models import CertificateDatastoreCredentials # type: ignore - from ._models import CertificateDatastoreSecrets # type: ignore - from ._models import Classification # type: ignore - from ._models import ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CodeConfiguration # type: ignore - from ._models import CodeContainer # type: ignore - from ._models import CodeContainerProperties # type: ignore - from ._models import CodeContainerResourceArmPaginatedResult # type: ignore - from ._models import CodeVersion # type: ignore - from ._models import CodeVersionProperties # type: ignore - from ._models import CodeVersionResourceArmPaginatedResult # type: ignore - from ._models import CognitiveServiceEndpointDeploymentResourceProperties # type: ignore - from ._models import CognitiveServicesSku # type: ignore - from ._models import Collection # type: ignore - from ._models import ColumnTransformer # type: ignore - from ._models import CommandJob # type: ignore - from ._models import CommandJobLimits # type: ignore - from ._models import ComponentContainer # type: ignore - from ._models import ComponentContainerProperties # type: ignore - from ._models import ComponentContainerResourceArmPaginatedResult # type: ignore - from ._models import ComponentVersion # type: ignore - from ._models import ComponentVersionProperties # type: ignore - from ._models import ComponentVersionResourceArmPaginatedResult # type: ignore - from ._models import Compute # type: ignore - from ._models import ComputeInstance # type: ignore - from ._models import ComputeInstanceApplication # type: ignore - from ._models import ComputeInstanceAutologgerSettings # type: ignore - from ._models import ComputeInstanceConnectivityEndpoints # type: ignore - from ._models import ComputeInstanceContainer # type: ignore - from ._models import ComputeInstanceCreatedBy # type: ignore - from ._models import ComputeInstanceDataDisk # type: ignore - from ._models import ComputeInstanceDataMount # type: ignore - from ._models import ComputeInstanceEnvironmentInfo # type: ignore - from ._models import ComputeInstanceLastOperation # type: ignore - from ._models import ComputeInstanceProperties # type: ignore - from ._models import ComputeInstanceSchema # type: ignore - from ._models import ComputeInstanceSshSettings # type: ignore - from ._models import ComputeInstanceVersion # type: ignore - from ._models import ComputeRecurrenceSchedule # type: ignore - from ._models import ComputeResource # type: ignore - from ._models import ComputeResourceSchema # type: ignore - from ._models import ComputeRuntimeDto # type: ignore - from ._models import ComputeSchedules # type: ignore - from ._models import ComputeSecrets # type: ignore - from ._models import ComputeStartStopSchedule # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import ContainerResourceSettings # type: ignore - from ._models import ContentSafety # type: ignore - from ._models import ContentSafetyEndpointDeploymentResourceProperties # type: ignore - from ._models import ContentSafetyEndpointResourceProperties # type: ignore - from ._models import CosmosDbSettings # type: ignore - from ._models import CreateMonitorAction # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomKeys # type: ignore - from ._models import CustomKeysWorkspaceConnectionProperties # type: ignore - from ._models import CustomMetricThreshold # type: ignore - from ._models import CustomModelFineTuning # type: ignore - from ._models import CustomModelJobInput # type: ignore - from ._models import CustomModelJobOutput # type: ignore - from ._models import CustomMonitoringSignal # type: ignore - from ._models import CustomNCrossValidations # type: ignore - from ._models import CustomSeasonality # type: ignore - from ._models import CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataCollector # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # type: ignore - from ._models import DataDriftMetricThresholdBase # type: ignore - from ._models import DataDriftMonitoringSignal # type: ignore - from ._models import DataFactory # type: ignore - from ._models import DataGenerationVertical # type: ignore - from ._models import DataLakeAnalytics # type: ignore - from ._models import DataLakeAnalyticsSchema # type: ignore - from ._models import DataLakeAnalyticsSchemaProperties # type: ignore - from ._models import DataPathAssetReference # type: ignore - from ._models import DataQualityMetricThresholdBase # type: ignore - from ._models import DataQualityMonitoringSignal # type: ignore - from ._models import DataReferenceCredential # type: ignore - from ._models import DataVersionBase # type: ignore - from ._models import DataVersionBaseProperties # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import Databricks # type: ignore - from ._models import DatabricksComputeSecrets # type: ignore - from ._models import DatabricksComputeSecretsProperties # type: ignore - from ._models import DatabricksProperties # type: ignore - from ._models import DatabricksSchema # type: ignore - from ._models import Datastore # type: ignore - from ._models import DatastoreCredentials # type: ignore - from ._models import DatastoreProperties # type: ignore - from ._models import DatastoreResourceArmPaginatedResult # type: ignore - from ._models import DatastoreSecrets # type: ignore - from ._models import DefaultScaleSettings # type: ignore - from ._models import DeltaModelCurrentState # type: ignore - from ._models import DeltaModelListRequest # type: ignore - from ._models import DeltaModelModifyRequest # type: ignore - from ._models import DeltaModelStatusRequest # type: ignore - from ._models import DeltaModelStatusResponse # type: ignore - from ._models import DeploymentLogs # type: ignore - from ._models import DeploymentLogsRequest # type: ignore - from ._models import DeploymentResourceConfiguration # type: ignore - from ._models import DestinationAsset # type: ignore - from ._models import DiagnoseRequestProperties # type: ignore - from ._models import DiagnoseResponseResult # type: ignore - from ._models import DiagnoseResponseResultValue # type: ignore - from ._models import DiagnoseResult # type: ignore - from ._models import DiagnoseWorkspaceParameters # type: ignore - from ._models import DistillationJob # type: ignore - from ._models import DistributionConfiguration # type: ignore - from ._models import Docker # type: ignore - from ._models import DockerCredential # type: ignore - from ._models import EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultUpdateProperties # type: ignore - from ._models import EncryptionProperty # type: ignore - from ._models import EncryptionUpdateProperties # type: ignore - from ._models import Endpoint # type: ignore - from ._models import EndpointAuthKeys # type: ignore - from ._models import EndpointAuthToken # type: ignore - from ._models import EndpointDeploymentModel # type: ignore - from ._models import EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointDeploymentResourceProperties # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResource # type: ignore - from ._models import EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointKeys # type: ignore - from ._models import EndpointModelDeprecationProperties # type: ignore - from ._models import EndpointModelProperties # type: ignore - from ._models import EndpointModelSkuCapacityProperties # type: ignore - from ._models import EndpointModelSkuProperties # type: ignore - from ._models import EndpointModelSkuRateLimitProperties # type: ignore - from ._models import EndpointModelSkuRateLimitRulePatternProperties # type: ignore - from ._models import EndpointModelSkuRateLimitRuleProperties # type: ignore - from ._models import EndpointModels # type: ignore - from ._models import EndpointPropertiesBase # type: ignore - from ._models import EndpointResourceProperties # type: ignore - from ._models import EndpointResourcePropertiesBasicResource # type: ignore - from ._models import EndpointResourcePropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import EndpointScheduleAction # type: ignore - from ._models import EnvironmentContainer # type: ignore - from ._models import EnvironmentContainerProperties # type: ignore - from ._models import EnvironmentContainerResourceArmPaginatedResult # type: ignore - from ._models import EnvironmentVariable # type: ignore - from ._models import EnvironmentVersion # type: ignore - from ._models import EnvironmentVersionProperties # type: ignore - from ._models import EnvironmentVersionResourceArmPaginatedResult # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import EstimatedVMPrice # type: ignore - from ._models import EstimatedVMPrices # type: ignore - from ._models import ExternalFQDNResponse # type: ignore - from ._models import FQDNEndpoint # type: ignore - from ._models import FQDNEndpointDetail # type: ignore - from ._models import FQDNEndpoints # type: ignore - from ._models import FQDNEndpointsPropertyBag # type: ignore - from ._models import Feature # type: ignore - from ._models import FeatureAttributionDriftMonitoringSignal # type: ignore - from ._models import FeatureAttributionMetricThreshold # type: ignore - from ._models import FeatureImportanceSettings # type: ignore - from ._models import FeatureProperties # type: ignore - from ._models import FeatureResourceArmPaginatedResult # type: ignore - from ._models import FeatureStoreSettings # type: ignore - from ._models import FeatureSubset # type: ignore - from ._models import FeatureWindow # type: ignore - from ._models import FeaturesetContainer # type: ignore - from ._models import FeaturesetContainerProperties # type: ignore - from ._models import FeaturesetContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturesetSpecification # type: ignore - from ._models import FeaturesetVersion # type: ignore - from ._models import FeaturesetVersionBackfillRequest # type: ignore - from ._models import FeaturesetVersionBackfillResponse # type: ignore - from ._models import FeaturesetVersionProperties # type: ignore - from ._models import FeaturesetVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityContainer # type: ignore - from ._models import FeaturestoreEntityContainerProperties # type: ignore - from ._models import FeaturestoreEntityContainerResourceArmPaginatedResult # type: ignore - from ._models import FeaturestoreEntityVersion # type: ignore - from ._models import FeaturestoreEntityVersionProperties # type: ignore - from ._models import FeaturestoreEntityVersionResourceArmPaginatedResult # type: ignore - from ._models import FeaturizationSettings # type: ignore - from ._models import FineTuningJob # type: ignore - from ._models import FineTuningVertical # type: ignore - from ._models import FinetuningDetails # type: ignore - from ._models import FixedInputData # type: ignore - from ._models import FlavorData # type: ignore - from ._models import ForecastHorizon # type: ignore - from ._models import Forecasting # type: ignore - from ._models import ForecastingSettings # type: ignore - from ._models import ForecastingTrainingSettings # type: ignore - from ._models import FqdnOutboundRule # type: ignore - from ._models import GetBlobReferenceForConsumptionDto # type: ignore - from ._models import GetBlobReferenceSASRequestDto # type: ignore - from ._models import GetBlobReferenceSASResponseDto # type: ignore - from ._models import GridSamplingAlgorithm # type: ignore - from ._models import GroupEnvironmentConfiguration # type: ignore - from ._models import GroupModelConfiguration # type: ignore - from ._models import GroupStatus # type: ignore - from ._models import HDInsight # type: ignore - from ._models import HDInsightProperties # type: ignore - from ._models import HDInsightSchema # type: ignore - from ._models import IPRule # type: ignore - from ._models import IdAssetReference # type: ignore - from ._models import IdentityConfiguration # type: ignore - from ._models import IdentityForCmk # type: ignore - from ._models import IdleShutdownSetting # type: ignore - from ._models import Image # type: ignore - from ._models import ImageClassification # type: ignore - from ._models import ImageClassificationBase # type: ignore - from ._models import ImageClassificationMultilabel # type: ignore - from ._models import ImageDetails # type: ignore - from ._models import ImageInfo # type: ignore - from ._models import ImageInstanceSegmentation # type: ignore - from ._models import ImageLimitSettings # type: ignore - from ._models import ImageMetadata # type: ignore - from ._models import ImageModelDistributionSettings # type: ignore - from ._models import ImageModelDistributionSettingsClassification # type: ignore - from ._models import ImageModelDistributionSettingsObjectDetection # type: ignore - from ._models import ImageModelSettings # type: ignore - from ._models import ImageModelSettingsClassification # type: ignore - from ._models import ImageModelSettingsObjectDetection # type: ignore - from ._models import ImageObjectDetection # type: ignore - from ._models import ImageObjectDetectionBase # type: ignore - from ._models import ImageSweepSettings # type: ignore - from ._models import ImageVertical # type: ignore - from ._models import IndexColumn # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InferenceEndpoint # type: ignore - from ._models import InferenceEndpointProperties # type: ignore - from ._models import InferenceEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferenceGroup # type: ignore - from ._models import InferenceGroupProperties # type: ignore - from ._models import InferenceGroupTrackedResourceArmPaginatedResult # type: ignore - from ._models import InferencePool # type: ignore - from ._models import InferencePoolProperties # type: ignore - from ._models import InferencePoolTrackedResourceArmPaginatedResult # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import JobBase # type: ignore - from ._models import JobBaseProperties # type: ignore - from ._models import JobBaseResourceArmPaginatedResult # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobLimits # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobResourceConfiguration # type: ignore - from ._models import JobResources # type: ignore - from ._models import JobScheduleAction # type: ignore - from ._models import JobService # type: ignore - from ._models import JupyterKernelConfig # type: ignore - from ._models import KeyVaultProperties # type: ignore - from ._models import Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelGeneration # type: ignore - from ._models import LakeHouseArtifact # type: ignore - from ._models import ListAmlUserFeatureResult # type: ignore - from ._models import ListNotebookKeysResult # type: ignore - from ._models import ListStorageAccountKeysResult # type: ignore - from ._models import ListUsagesResult # type: ignore - from ._models import ListWorkspaceKeysResult # type: ignore - from ._models import ListWorkspaceQuotas # type: ignore - from ._models import LiteralJobInput # type: ignore - from ._models import MLFlowModelJobInput # type: ignore - from ._models import MLFlowModelJobOutput # type: ignore - from ._models import MLTableData # type: ignore - from ._models import MLTableJobInput # type: ignore - from ._models import MLTableJobOutput # type: ignore - from ._models import ManagedComputeIdentity # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedIdentityCredential # type: ignore - from ._models import ManagedNetworkProvisionOptions # type: ignore - from ._models import ManagedNetworkProvisionStatus # type: ignore - from ._models import ManagedNetworkSettings # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedOnlineEndpointDeploymentResourceProperties # type: ignore - from ._models import ManagedOnlineEndpointResourceProperties # type: ignore - from ._models import ManagedResourceGroupAssignedIdentities # type: ignore - from ._models import ManagedResourceGroupSettings # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MarketplacePlan # type: ignore - from ._models import MarketplaceSubscription # type: ignore - from ._models import MarketplaceSubscriptionProperties # type: ignore - from ._models import MarketplaceSubscriptionResourceArmPaginatedResult # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelSettings # type: ignore - from ._models import ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import MonitorComputeConfigurationBase # type: ignore - from ._models import MonitorComputeIdentityBase # type: ignore - from ._models import MonitorDefinition # type: ignore - from ._models import MonitorEmailNotificationSettings # type: ignore - from ._models import MonitorNotificationSettings # type: ignore - from ._models import MonitorServerlessSparkCompute # type: ignore - from ._models import MonitoringFeatureFilterBase # type: ignore - from ._models import MonitoringInputDataBase # type: ignore - from ._models import MonitoringSignalBase # type: ignore - from ._models import MonitoringTarget # type: ignore - from ._models import MonitoringThreshold # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NetworkAcls # type: ignore - from ._models import NlpVertical # type: ignore - from ._models import NlpVerticalFeaturizationSettings # type: ignore - from ._models import NlpVerticalLimitSettings # type: ignore - from ._models import NodeStateCounts # type: ignore - from ._models import Nodes # type: ignore - from ._models import NoneAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NoneDatastoreCredentials # type: ignore - from ._models import NotebookAccessTokenResult # type: ignore - from ._models import NotebookPreparationError # type: ignore - from ._models import NotebookResourceInfo # type: ignore - from ._models import NotificationSetting # type: ignore - from ._models import NumericalDataDriftMetricThreshold # type: ignore - from ._models import NumericalDataQualityMetricThreshold # type: ignore - from ._models import NumericalPredictionDriftMetricThreshold # type: ignore - from ._models import OAuth2AuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import Objective # type: ignore - from ._models import OneLakeArtifact # type: ignore - from ._models import OneLakeDatastore # type: ignore - from ._models import OnlineDeployment # type: ignore - from ._models import OnlineDeploymentProperties # type: ignore - from ._models import OnlineDeploymentTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineEndpoint # type: ignore - from ._models import OnlineEndpointProperties # type: ignore - from ._models import OnlineEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OpenAIEndpointDeploymentResourceProperties # type: ignore - from ._models import OpenAIEndpointResourceProperties # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OsPatchingStatus # type: ignore - from ._models import OutboundRule # type: ignore - from ._models import OutboundRuleBasicResource # type: ignore - from ._models import OutboundRuleListResult # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PTUDeploymentUsage # type: ignore - from ._models import PackageDetails # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties # type: ignore - from ._models import PartialManagedServiceIdentity # type: ignore - from ._models import PartialMinimalTrackedResource # type: ignore - from ._models import PartialMinimalTrackedResourceWithIdentity # type: ignore - from ._models import PartialMinimalTrackedResourceWithSku # type: ignore - from ._models import PartialMinimalTrackedResourceWithSkuAndIdentity # type: ignore - from ._models import PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PendingUploadCredentialDto # type: ignore - from ._models import PendingUploadRequestDto # type: ignore - from ._models import PendingUploadResponseDto # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # type: ignore - from ._models import PredictionDriftMetricThresholdBase # type: ignore - from ._models import PredictionDriftMonitoringSignal # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateEndpointDestination # type: ignore - from ._models import PrivateEndpointOutboundRule # type: ignore - from ._models import PrivateEndpointResource # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import PromptSettings # type: ignore - from ._models import PropertiesBase # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QueueSettings # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import RaiBlocklistConfig # type: ignore - from ._models import RaiBlocklistItemBulkRequest # type: ignore - from ._models import RaiBlocklistItemProperties # type: ignore - from ._models import RaiBlocklistItemPropertiesBasicResource # type: ignore - from ._models import RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RaiBlocklistProperties # type: ignore - from ._models import RaiBlocklistPropertiesBasicResource # type: ignore - from ._models import RaiBlocklistPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RaiPolicyContentFilter # type: ignore - from ._models import RaiPolicyProperties # type: ignore - from ._models import RaiPolicyPropertiesBasicResource # type: ignore - from ._models import RaiPolicyPropertiesBasicResourceArmPaginatedResult # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import Recurrence # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import RegenerateServiceAccountKeyContent # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryPartialManagedServiceIdentity # type: ignore - from ._models import RegistryPrivateEndpointConnection # type: ignore - from ._models import RegistryPrivateLinkServiceConnectionState # type: ignore - from ._models import RegistryRegionArmDetails # type: ignore - from ._models import RegistryTrackedResourceArmPaginatedResult # type: ignore - from ._models import Regression # type: ignore - from ._models import RegressionTrainingSettings # type: ignore - from ._models import RequestConfiguration # type: ignore - from ._models import RequestLogging # type: ignore - from ._models import ResizeSchema # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceBase # type: ignore - from ._models import ResourceConfiguration # type: ignore - from ._models import ResourceId # type: ignore - from ._models import ResourceName # type: ignore - from ._models import ResourceQuota # type: ignore - from ._models import RollingInputData # type: ignore - from ._models import Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import SASCredential # type: ignore - from ._models import SASCredentialDto # type: ignore - from ._models import SamplingAlgorithm # type: ignore - from ._models import SasDatastoreCredentials # type: ignore - from ._models import SasDatastoreSecrets # type: ignore - from ._models import ScaleSettings # type: ignore - from ._models import ScaleSettingsInformation # type: ignore - from ._models import ScaleUnitConfiguration # type: ignore - from ._models import Schedule # type: ignore - from ._models import ScheduleActionBase # type: ignore - from ._models import ScheduleBase # type: ignore - from ._models import ScheduleProperties # type: ignore - from ._models import ScheduleResourceArmPaginatedResult # type: ignore - from ._models import ScriptReference # type: ignore - from ._models import ScriptsToExecute # type: ignore - from ._models import Seasonality # type: ignore - from ._models import SecretExpiry # type: ignore - from ._models import ServerlessComputeSettings # type: ignore - from ._models import ServerlessEndpoint # type: ignore - from ._models import ServerlessEndpointCapacityReservation # type: ignore - from ._models import ServerlessEndpointContentSafety # type: ignore - from ._models import ServerlessEndpointInferenceEndpoint # type: ignore - from ._models import ServerlessEndpointModelSettings # type: ignore - from ._models import ServerlessEndpointProperties # type: ignore - from ._models import ServerlessEndpointResourceProperties # type: ignore - from ._models import ServerlessEndpointTrackedResourceArmPaginatedResult # type: ignore - from ._models import ServerlessInferenceEndpoint # type: ignore - from ._models import ServerlessOffer # type: ignore - from ._models import ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # type: ignore - from ._models import ServiceTagDestination # type: ignore - from ._models import ServiceTagOutboundRule # type: ignore - from ._models import SetupScripts # type: ignore - from ._models import SharedPrivateLinkResource # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuResource # type: ignore - from ._models import SkuResourceArmPaginatedResult # type: ignore - from ._models import SkuSetting # type: ignore - from ._models import SparkJob # type: ignore - from ._models import SparkJobEntry # type: ignore - from ._models import SparkJobPythonEntry # type: ignore - from ._models import SparkJobScalaEntry # type: ignore - from ._models import SparkResourceConfiguration # type: ignore - from ._models import SpeechEndpointDeploymentResourceProperties # type: ignore - from ._models import SpeechEndpointResourceProperties # type: ignore - from ._models import SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StaticInputData # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import StringArmPaginatedResult # type: ignore - from ._models import StringKeyValuePair # type: ignore - from ._models import SweepJob # type: ignore - from ._models import SweepJobLimits # type: ignore - from ._models import SynapseSpark # type: ignore - from ._models import SynapseSparkProperties # type: ignore - from ._models import SystemCreatedAcrAccount # type: ignore - from ._models import SystemCreatedStorageAccount # type: ignore - from ._models import SystemData # type: ignore - from ._models import SystemService # type: ignore - from ._models import TableVertical # type: ignore - from ._models import TableVerticalFeaturizationSettings # type: ignore - from ._models import TableVerticalLimitSettings # type: ignore - from ._models import TargetLags # type: ignore - from ._models import TargetRollingWindowSize # type: ignore - from ._models import TargetUtilizationScaleSettings # type: ignore - from ._models import TeacherModelEndpoint # type: ignore - from ._models import TeacherModelEndpointRequestSettings # type: ignore - from ._models import TeacherModelSettings # type: ignore - from ._models import TensorFlow # type: ignore - from ._models import TextClassification # type: ignore - from ._models import TextClassificationMultilabel # type: ignore - from ._models import TextNer # type: ignore - from ._models import TmpfsOptions # type: ignore - from ._models import TopNFeaturesByAttribution # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TritonModelJobInput # type: ignore - from ._models import TritonModelJobOutput # type: ignore - from ._models import TruncationSelectionPolicy # type: ignore - from ._models import UpdateWorkspaceQuotas # type: ignore - from ._models import UpdateWorkspaceQuotasResult # type: ignore - from ._models import UriFileDataVersion # type: ignore - from ._models import UriFileJobInput # type: ignore - from ._models import UriFileJobOutput # type: ignore - from ._models import UriFolderDataVersion # type: ignore - from ._models import UriFolderJobInput # type: ignore - from ._models import UriFolderJobOutput # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageAndQuotaDetails # type: ignore - from ._models import UsageAndQuotaDetailsArmPaginatedResult # type: ignore - from ._models import UsageName # type: ignore - from ._models import UserAccountCredentials # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserCreatedAcrAccount # type: ignore - from ._models import UserCreatedStorageAccount # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import UsernamePasswordAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import VirtualMachine # type: ignore - from ._models import VirtualMachineImage # type: ignore - from ._models import VirtualMachineSchema # type: ignore - from ._models import VirtualMachineSchemaProperties # type: ignore - from ._models import VirtualMachineSecrets # type: ignore - from ._models import VirtualMachineSecretsSchema # type: ignore - from ._models import VirtualMachineSize # type: ignore - from ._models import VirtualMachineSizeListResult # type: ignore - from ._models import VirtualMachineSshCredentials # type: ignore - from ._models import VolumeDefinition # type: ignore - from ._models import VolumeOptions # type: ignore - from ._models import VulnerabilityDetails # type: ignore - from ._models import VulnerabilityFindings # type: ignore - from ._models import Webhook # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionAccountKey # type: ignore - from ._models import WorkspaceConnectionApiKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # type: ignore - from ._models import WorkspaceConnectionOAuth2 # type: ignore - from ._models import WorkspaceConnectionPersonalAccessToken # type: ignore - from ._models import WorkspaceConnectionPropertiesV2 # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResource # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult # type: ignore - from ._models import WorkspaceConnectionServicePrincipal # type: ignore - from ._models import WorkspaceConnectionSharedAccessSignature # type: ignore - from ._models import WorkspaceConnectionUpdateParameter # type: ignore - from ._models import WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceHubConfig # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspacePrivateEndpointResource # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - ActionType, - AllocationState, - AllowedContentLevel, - ApplicationSharingPolicy, - AssetProvisioningState, - AuthMode, - AutoRebuildSetting, - Autosave, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CapabilityHostKind, - CapabilityHostProvisioningState, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeRecurrenceFrequency, - ComputeTriggerType, - ComputeType, - ComputeWeekDay, - ConnectionAuthType, - ConnectionCategory, - ConnectionGroup, - ContainerType, - ContentSafetyLevel, - ContentSafetyStatus, - CreatedByType, - CredentialsType, - DataAvailabilityStatus, - DataCollectionMode, - DataGenerationTaskType, - DataGenerationType, - DataReferenceCredentialType, - DataType, - DatastoreType, - DefaultActionType, - DefaultResourceProvisioningState, - DeploymentModelVersionUpgradeOption, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EndpointType, - EnvironmentType, - EnvironmentVariableType, - FeatureAttributionMetric, - FeatureDataType, - FeatureImportanceMode, - FeatureLags, - FeaturizationMode, - FineTuningTaskType, - FirewallSku, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - ImageType, - InputDeliveryMode, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogVerbosity, - ManagedNetworkStatus, - ManagedPERequirement, - ManagedPEStatus, - ManagedServiceIdentityType, - MarketplaceSubscriptionProvisioningState, - MarketplaceSubscriptionStatus, - MaterializationStoreType, - MlflowAutologger, - ModelLifecycleStatus, - ModelProvider, - ModelSize, - ModelTaskType, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringNotificationType, - MonitoringSignalType, - MountAction, - MountMode, - MountState, - NCrossValidationsMode, - Network, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - Origin, - OsType, - OutputDeliveryMode, - PatchStatus, - PendingUploadCredentialType, - PendingUploadType, - PoolProvisioningState, - PrivateEndpointConnectionProvisioningState, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccessType, - QuotaUnit, - RaiPolicyContentSource, - RaiPolicyMode, - RaiPolicyType, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleAction, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServerlessEndpointState, - ServerlessInferenceEndpointAuthMode, - ServiceAccountKeyName, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StochasticOptimizer, - StorageAccountType, - SystemDatastoresAuthMode, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - VmPriority, - VolumeDefinitionType, - VulnerabilityRisk, - WebhookType, - WeekDay, -) - -__all__ = [ - 'AADAuthTypeWorkspaceConnectionProperties', - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountApiKeys', - 'AccountKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'ActualCapacityInfo', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlToken', - 'AmlTokenComputeIdentity', - 'AmlUserFeature', - 'AnonymousAccessCredential', - 'ApiKeyAuthWorkspaceConnectionProperties', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AvailableQuota', - 'AvailableQuotaArmPaginatedResult', - 'AvailableQuotaProperties', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureOpenAiFineTuning', - 'AzureOpenAiHyperParameters', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CapabilityHost', - 'CapabilityHostProperties', - 'CapacityConfig', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'CognitiveServiceEndpointDeploymentResourceProperties', - 'CognitiveServicesSku', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeRecurrenceSchedule', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'ContentSafety', - 'ContentSafetyEndpointDeploymentResourceProperties', - 'ContentSafetyEndpointResourceProperties', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CustomForecastHorizon', - 'CustomKeys', - 'CustomKeysWorkspaceConnectionProperties', - 'CustomMetricThreshold', - 'CustomModelFineTuning', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataGenerationVertical', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataReferenceCredential', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeltaModelCurrentState', - 'DeltaModelListRequest', - 'DeltaModelModifyRequest', - 'DeltaModelStatusRequest', - 'DeltaModelStatusResponse', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DestinationAsset', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistillationJob', - 'DistributionConfiguration', - 'Docker', - 'DockerCredential', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentModel', - 'EndpointDeploymentPropertiesBase', - 'EndpointDeploymentResourceProperties', - 'EndpointDeploymentResourcePropertiesBasicResource', - 'EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointKeys', - 'EndpointModelDeprecationProperties', - 'EndpointModelProperties', - 'EndpointModelSkuCapacityProperties', - 'EndpointModelSkuProperties', - 'EndpointModelSkuRateLimitProperties', - 'EndpointModelSkuRateLimitRulePatternProperties', - 'EndpointModelSkuRateLimitRuleProperties', - 'EndpointModels', - 'EndpointPropertiesBase', - 'EndpointResourceProperties', - 'EndpointResourcePropertiesBasicResource', - 'EndpointResourcePropertiesBasicResourceArmPaginatedResult', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsPropertyBag', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureImportanceSettings', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionBackfillResponse', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FineTuningJob', - 'FineTuningVertical', - 'FinetuningDetails', - 'FixedInputData', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GetBlobReferenceForConsumptionDto', - 'GetBlobReferenceSASRequestDto', - 'GetBlobReferenceSASResponseDto', - 'GridSamplingAlgorithm', - 'GroupEnvironmentConfiguration', - 'GroupModelConfiguration', - 'GroupStatus', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'IPRule', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageDetails', - 'ImageInfo', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferenceEndpoint', - 'InferenceEndpointProperties', - 'InferenceEndpointTrackedResourceArmPaginatedResult', - 'InferenceGroup', - 'InferenceGroupProperties', - 'InferenceGroupTrackedResourceArmPaginatedResult', - 'InferencePool', - 'InferencePoolProperties', - 'InferencePoolTrackedResourceArmPaginatedResult', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobResources', - 'JobScheduleAction', - 'JobService', - 'JupyterKernelConfig', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelGeneration', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedComputeIdentity', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedIdentityCredential', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedOnlineEndpointDeploymentResourceProperties', - 'ManagedOnlineEndpointResourceProperties', - 'ManagedResourceGroupAssignedIdentities', - 'ManagedResourceGroupSettings', - 'ManagedServiceIdentity', - 'MarketplacePlan', - 'MarketplaceSubscription', - 'MarketplaceSubscriptionProperties', - 'MarketplaceSubscriptionResourceArmPaginatedResult', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelSettings', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorComputeConfigurationBase', - 'MonitorComputeIdentityBase', - 'MonitorDefinition', - 'MonitorEmailNotificationSettings', - 'MonitorNotificationSettings', - 'MonitorServerlessSparkCompute', - 'MonitoringFeatureFilterBase', - 'MonitoringInputDataBase', - 'MonitoringSignalBase', - 'MonitoringTarget', - 'MonitoringThreshold', - 'Mpi', - 'NCrossValidations', - 'NetworkAcls', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'OAuth2AuthTypeWorkspaceConnectionProperties', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OpenAIEndpointDeploymentResourceProperties', - 'OpenAIEndpointResourceProperties', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OsPatchingStatus', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PTUDeploymentUsage', - 'PackageDetails', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialMinimalTrackedResourceWithSkuAndIdentity', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'PromptSettings', - 'PropertiesBase', - 'ProxyResource', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RaiBlocklistConfig', - 'RaiBlocklistItemBulkRequest', - 'RaiBlocklistItemProperties', - 'RaiBlocklistItemPropertiesBasicResource', - 'RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult', - 'RaiBlocklistProperties', - 'RaiBlocklistPropertiesBasicResource', - 'RaiBlocklistPropertiesBasicResourceArmPaginatedResult', - 'RaiPolicyContentFilter', - 'RaiPolicyProperties', - 'RaiPolicyPropertiesBasicResource', - 'RaiPolicyPropertiesBasicResourceArmPaginatedResult', - 'RandomSamplingAlgorithm', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'RegenerateServiceAccountKeyContent', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryPartialManagedServiceIdentity', - 'RegistryPrivateEndpointConnection', - 'RegistryPrivateLinkServiceConnectionState', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionTrainingSettings', - 'RequestConfiguration', - 'RequestLogging', - 'ResizeSchema', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'RollingInputData', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredential', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'ScaleUnitConfiguration', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretExpiry', - 'ServerlessComputeSettings', - 'ServerlessEndpoint', - 'ServerlessEndpointCapacityReservation', - 'ServerlessEndpointContentSafety', - 'ServerlessEndpointInferenceEndpoint', - 'ServerlessEndpointModelSettings', - 'ServerlessEndpointProperties', - 'ServerlessEndpointResourceProperties', - 'ServerlessEndpointTrackedResourceArmPaginatedResult', - 'ServerlessInferenceEndpoint', - 'ServerlessOffer', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SpeechEndpointDeploymentResourceProperties', - 'SpeechEndpointResourceProperties', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StaticInputData', - 'StorageAccountDetails', - 'StringArmPaginatedResult', - 'StringKeyValuePair', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TeacherModelEndpoint', - 'TeacherModelEndpointRequestSettings', - 'TeacherModelSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageAndQuotaDetails', - 'UsageAndQuotaDetailsArmPaginatedResult', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'VulnerabilityDetails', - 'VulnerabilityFindings', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionAccountKey', - 'WorkspaceConnectionApiKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionOAuth2', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUpdateParameter', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceHubConfig', - 'WorkspaceListResult', - 'WorkspacePrivateEndpointResource', - 'WorkspaceUpdateParameters', - 'ActionType', - 'AllocationState', - 'AllowedContentLevel', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AuthMode', - 'AutoRebuildSetting', - 'Autosave', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CapabilityHostKind', - 'CapabilityHostProvisioningState', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeRecurrenceFrequency', - 'ComputeTriggerType', - 'ComputeType', - 'ComputeWeekDay', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ConnectionGroup', - 'ContainerType', - 'ContentSafetyLevel', - 'ContentSafetyStatus', - 'CreatedByType', - 'CredentialsType', - 'DataAvailabilityStatus', - 'DataCollectionMode', - 'DataGenerationTaskType', - 'DataGenerationType', - 'DataReferenceCredentialType', - 'DataType', - 'DatastoreType', - 'DefaultActionType', - 'DefaultResourceProvisioningState', - 'DeploymentModelVersionUpgradeOption', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EndpointType', - 'EnvironmentType', - 'EnvironmentVariableType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureImportanceMode', - 'FeatureLags', - 'FeaturizationMode', - 'FineTuningTaskType', - 'FirewallSku', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'ManagedNetworkStatus', - 'ManagedPERequirement', - 'ManagedPEStatus', - 'ManagedServiceIdentityType', - 'MarketplaceSubscriptionProvisioningState', - 'MarketplaceSubscriptionStatus', - 'MaterializationStoreType', - 'MlflowAutologger', - 'ModelLifecycleStatus', - 'ModelProvider', - 'ModelSize', - 'ModelTaskType', - 'MonitorComputeIdentityType', - 'MonitorComputeType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataType', - 'MonitoringNotificationType', - 'MonitoringSignalType', - 'MountAction', - 'MountMode', - 'MountState', - 'NCrossValidationsMode', - 'Network', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'Origin', - 'OsType', - 'OutputDeliveryMode', - 'PatchStatus', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PoolProvisioningState', - 'PrivateEndpointConnectionProvisioningState', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RaiPolicyContentSource', - 'RaiPolicyMode', - 'RaiPolicyType', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleAction', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServerlessEndpointState', - 'ServerlessInferenceEndpointAuthMode', - 'ServiceAccountKeyName', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StochasticOptimizer', - 'StorageAccountType', - 'SystemDatastoresAuthMode', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'VmPriority', - 'VolumeDefinitionType', - 'VulnerabilityRisk', - 'WebhookType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index e7f2ab3a3f64..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,2133 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from six import with_metaclass -from azure.core import CaseInsensitiveEnumMeta - - -class ActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ - - INTERNAL = "Internal" - -class AllocationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - RESIZING = "Resizing" - -class AllowedContentLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level at which content is filtered. - """ - - LOW = "Low" - MEDIUM = "Medium" - HIGH = "High" - -class ApplicationSharingPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - SHARED = "Shared" - -class AssetProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class AuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AAD = "AAD" - -class AutoRebuildSetting(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoRebuild setting for the derived image - """ - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - -class Autosave(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -class BatchDeploymentConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated property types for batch deployments. - """ - - MODEL = "Model" - PIPELINE_COMPONENT = "PipelineComponent" - -class BatchLoggingLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Log verbosity for batch inferencing. - Increasing verbosity order for logging is : Warning, Info and Debug. - The default value is Info. - """ - - INFO = "Info" - WARNING = "Warning" - DEBUG = "Debug" - -class BatchOutputAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine how batch inferencing will handle output - """ - - SUMMARY_ONLY = "SummaryOnly" - APPEND_ROW = "AppendRow" - -class BillingCurrency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Target encoding for text data. - TEXT_TARGET_ENCODER = "TextTargetEncoder" - #: Ohe hot encoding creates a binary feature transformation. - ONE_HOT_ENCODER = "OneHotEncoder" - #: Target encoding for categorical data. - CAT_TARGET_ENCODER = "CatTargetEncoder" - #: Tf-Idf stands for, term-frequency times inverse document-frequency. This is a common term - #: weighting scheme for identifying information from documents. - TF_IDF = "TfIdf" - #: Weight of Evidence encoding is a technique used to encode categorical variables. It uses the - #: natural log of the P(1)/P(0) to create weights. - WO_E_TARGET_ENCODER = "WoETargetEncoder" - #: Label encoder converts labels/categorical variables in a numerical form. - LABEL_ENCODER = "LabelEncoder" - #: Word embedding helps represents words or phrases as a vector, or a series of numbers. - WORD_EMBEDDING = "WordEmbedding" - #: Naive Bayes is a classified that is used for classification of discrete features that are - #: categorically distributed. - NAIVE_BAYES = "NaiveBayes" - #: Count Vectorizer converts a collection of text documents to a matrix of token counts. - COUNT_VECTORIZER = "CountVectorizer" - #: Hashing One Hot Encoder can turn categorical variables into a limited number of new features. - #: This is often used for high-cardinality categorical features. - HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" - -class Caching(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class CapabilityHostKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - AGENTS = "Agents" - -class CapabilityHostProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of capability host. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class CategoricalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class CategoricalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Pearsons Chi Squared Test metric. - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - -class ClassificationModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ - - #: Logistic regression is a fundamental classification technique. - #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear - #: regression. - #: Logistic regression is fast and relatively uncomplicated, and it's convenient for you to - #: interpret the results. - #: Although it's essentially a method for binary classification, it can also be applied to - #: multiclass problems. - LOGISTIC_REGRESSION = "LogisticRegression" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - SGD = "SGD" - #: The multinomial Naive Bayes classifier is suitable for classification with discrete features - #: (e.g., word counts for text classification). - #: The multinomial distribution normally requires integer feature counts. However, in practice, - #: fractional counts such as tf-idf may also work. - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - #: Naive Bayes classifier for multivariate Bernoulli models. - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - SVM = "SVM" - #: A support vector machine (SVM) is a supervised machine learning model that uses classification - #: algorithms for two-group classification problems. - #: After giving an SVM model sets of labeled training data for each category, they're able to - #: categorize new text. - #: Linear SVM performs best when input data is linear, i.e., data can be easily classified by - #: drawing the straight line between classified values on a plotted graph. - LINEAR_SVM = "LinearSVM" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the "bagging" - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - #: target column values can be divided into distinct class values. - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - -class ClassificationMultilabelPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification multilabel tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - #: Intersection Over Union. Intersection of predictions divided by union of predictions. - IOU = "IOU" - -class ClassificationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification tasks. - """ - - #: AUC is the Area under the curve. - #: This metric represents arithmetic mean of the score for each class, - #: weighted by the number of true instances in each class. - AUC_WEIGHTED = "AUCWeighted" - #: Accuracy is the ratio of predictions that exactly match the true class labels. - ACCURACY = "Accuracy" - #: Normalized macro recall is recall macro-averaged and normalized, so that random - #: performance has a score of 0, and perfect performance has a score of 1. - NORM_MACRO_RECALL = "NormMacroRecall" - #: The arithmetic mean of the average precision score for each class, weighted by - #: the number of true instances in each class. - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - #: The arithmetic mean of precision for each class, weighted by number of true instances in each - #: class. - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - -class ClusterPurpose(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Intended usage of the cluster - """ - - FAST_PROD = "FastProd" - DENSE_PROD = "DenseProd" - DEV_TEST = "DevTest" - -class ComputeInstanceAuthorizationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Compute Instance Authorization type. Available values are personal (default). - """ - - PERSONAL = "personal" - -class ComputeInstanceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Current state of an ComputeInstance. - """ - - CREATING = "Creating" - CREATE_FAILED = "CreateFailed" - DELETING = "Deleting" - RUNNING = "Running" - RESTARTING = "Restarting" - RESIZING = "Resizing" - JOB_RUNNING = "JobRunning" - SETTING_UP = "SettingUp" - SETUP_FAILED = "SetupFailed" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - USER_SETTING_UP = "UserSettingUp" - USER_SETUP_FAILED = "UserSetupFailed" - UNKNOWN = "Unknown" - UNUSABLE = "Unusable" - -class ComputePowerAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """[Required] The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeRecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a compute recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ComputeTriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class ComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of compute - """ - - AKS = "AKS" - KUBERNETES = "Kubernetes" - AML_COMPUTE = "AmlCompute" - COMPUTE_INSTANCE = "ComputeInstance" - DATA_FACTORY = "DataFactory" - VIRTUAL_MACHINE = "VirtualMachine" - HD_INSIGHT = "HDInsight" - DATABRICKS = "Databricks" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - SYNAPSE_SPARK = "SynapseSpark" - -class ComputeWeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" - -class ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - ACCOUNT_KEY = "AccountKey" - SERVICE_PRINCIPAL = "ServicePrincipal" - ACCESS_KEY = "AccessKey" - API_KEY = "ApiKey" - CUSTOM_KEYS = "CustomKeys" - O_AUTH2 = "OAuth2" - AAD = "AAD" - -class ConnectionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - AZURE_MY_SQL_DB = "AzureMySqlDb" - AZURE_POSTGRES_DB = "AzurePostgresDb" - ADLS_GEN2 = "ADLSGen2" - REDIS = "Redis" - API_KEY = "ApiKey" - AZURE_OPEN_AI = "AzureOpenAI" - AI_SERVICES = "AIServices" - COGNITIVE_SEARCH = "CognitiveSearch" - COGNITIVE_SERVICE = "CognitiveService" - CUSTOM_KEYS = "CustomKeys" - AZURE_BLOB = "AzureBlob" - AZURE_ONE_LAKE = "AzureOneLake" - COSMOS_DB = "CosmosDb" - COSMOS_DB_MONGO_DB_API = "CosmosDbMongoDbApi" - AZURE_DATA_EXPLORER = "AzureDataExplorer" - AZURE_MARIA_DB = "AzureMariaDb" - AZURE_DATABRICKS_DELTA_LAKE = "AzureDatabricksDeltaLake" - AZURE_SQL_MI = "AzureSqlMi" - AZURE_TABLE_STORAGE = "AzureTableStorage" - AMAZON_RDS_FOR_ORACLE = "AmazonRdsForOracle" - AMAZON_RDS_FOR_SQL_SERVER = "AmazonRdsForSqlServer" - AMAZON_REDSHIFT = "AmazonRedshift" - DB2 = "Db2" - DRILL = "Drill" - GOOGLE_BIG_QUERY = "GoogleBigQuery" - GREENPLUM = "Greenplum" - HBASE = "Hbase" - HIVE = "Hive" - IMPALA = "Impala" - INFORMIX = "Informix" - MARIA_DB = "MariaDb" - MICROSOFT_ACCESS = "MicrosoftAccess" - MY_SQL = "MySql" - NETEZZA = "Netezza" - ORACLE = "Oracle" - PHOENIX = "Phoenix" - POSTGRE_SQL = "PostgreSql" - PRESTO = "Presto" - SAP_OPEN_HUB = "SapOpenHub" - SAP_BW = "SapBw" - SAP_HANA = "SapHana" - SAP_TABLE = "SapTable" - SPARK = "Spark" - SQL_SERVER = "SqlServer" - SYBASE = "Sybase" - TERADATA = "Teradata" - VERTICA = "Vertica" - PINECONE = "Pinecone" - CASSANDRA = "Cassandra" - COUCHBASE = "Couchbase" - MONGO_DB_V2 = "MongoDbV2" - MONGO_DB_ATLAS = "MongoDbAtlas" - AMAZON_S3_COMPATIBLE = "AmazonS3Compatible" - FILE_SERVER = "FileServer" - FTP_SERVER = "FtpServer" - GOOGLE_CLOUD_STORAGE = "GoogleCloudStorage" - HDFS = "Hdfs" - ORACLE_CLOUD_STORAGE = "OracleCloudStorage" - SFTP = "Sftp" - GENERIC_HTTP = "GenericHttp" - O_DATA_REST = "ODataRest" - ODBC = "Odbc" - GENERIC_REST = "GenericRest" - AMAZON_MWS = "AmazonMws" - CONCUR = "Concur" - DYNAMICS = "Dynamics" - DYNAMICS_AX = "DynamicsAx" - DYNAMICS_CRM = "DynamicsCrm" - GOOGLE_AD_WORDS = "GoogleAdWords" - HUBSPOT = "Hubspot" - JIRA = "Jira" - MAGENTO = "Magento" - MARKETO = "Marketo" - OFFICE365 = "Office365" - ELOQUA = "Eloqua" - RESPONSYS = "Responsys" - ORACLE_SERVICE_CLOUD = "OracleServiceCloud" - PAY_PAL = "PayPal" - QUICK_BOOKS = "QuickBooks" - SALESFORCE = "Salesforce" - SALESFORCE_SERVICE_CLOUD = "SalesforceServiceCloud" - SALESFORCE_MARKETING_CLOUD = "SalesforceMarketingCloud" - SAP_CLOUD_FOR_CUSTOMER = "SapCloudForCustomer" - SAP_ECC = "SapEcc" - SERVICE_NOW = "ServiceNow" - SHARE_POINT_ONLINE_LIST = "SharePointOnlineList" - SHOPIFY = "Shopify" - SQUARE = "Square" - WEB_TABLE = "WebTable" - XERO = "Xero" - ZOHO = "Zoho" - GENERIC_CONTAINER_REGISTRY = "GenericContainerRegistry" - ELASTICSEARCH = "Elasticsearch" - OPEN_AI = "OpenAI" - SERP = "Serp" - BING_LLM_SEARCH = "BingLLMSearch" - SERVERLESS = "Serverless" - MANAGED_ONLINE_ENDPOINT = "ManagedOnlineEndpoint" - -class ConnectionGroup(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Group based on connection category - """ - - AZURE = "Azure" - AZURE_AI = "AzureAI" - DATABASE = "Database" - NO_SQL = "NoSQL" - FILE = "File" - GENERIC_PROTOCOL = "GenericProtocol" - SERVICES_AND_APPS = "ServicesAndApps" - -class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - STORAGE_INITIALIZER = "StorageInitializer" - INFERENCE_SERVER = "InferenceServer" - -class ContentSafetyLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the current safety level for content safety. - """ - - BLOCKING = "Blocking" - DEFERRED = "Deferred" - -class ContentSafetyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the status of content safety. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore credentials type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - NONE = "None" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - -class DataAvailabilityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - PENDING = "Pending" - INCOMPLETE = "Incomplete" - COMPLETE = "Complete" - -class DataCollectionMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class DataGenerationTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of Data Generation Task. - """ - - #: Generate conversational data (multi/single turn). - CONVERSATION = "Conversation" - #: Generate Math data for numerical responses. - MATH = "Math" - #: Generate Natural Language Inference data. - NLI = "Nli" - #: Generate Natural Language Understanding data for Question Answering data. - NLU_QA = "NluQa" - #: Generate Key Summary for an Article. - SUMMARIZATION = "Summarization" - -class DataGenerationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of Data Generation. - """ - - #: Label Generation by Teacher Model Inferencing. - LABEL_GENERATION = "LabelGeneration" - #: Synthetic Data Generation. - DATA_GENERATION = "DataGeneration" - -class DataReferenceCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the DataReference credentials type. - """ - - SAS = "SAS" - DOCKER_CREDENTIALS = "DockerCredentials" - MANAGED_IDENTITY = "ManagedIdentity" - NO_CREDENTIALS = "NoCredentials" - -class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore contents type. - """ - - AZURE_BLOB = "AzureBlob" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - AZURE_FILE = "AzureFile" - ONE_LAKE = "OneLake" - -class DataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - -class DefaultActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DENY = "Deny" - ALLOW = "Allow" - -class DefaultResourceProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NOT_STARTED = "NotStarted" - FAILED = "Failed" - CREATING = "Creating" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - DELETING = "Deleting" - ACCEPTED = "Accepted" - CANCELED = "Canceled" - SCALING = "Scaling" - DISABLED = "Disabled" - -class DeploymentModelVersionUpgradeOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Deployment model version upgrade option. - """ - - ONCE_NEW_DEFAULT_VERSION_AVAILABLE = "OnceNewDefaultVersionAvailable" - ONCE_CURRENT_VERSION_EXPIRED = "OnceCurrentVersionExpired" - NO_AUTO_UPGRADE = "NoAutoUpgrade" - -class DeploymentProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Possible values for DeploymentProvisioningState. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SCALING = "Scaling" - UPDATING = "Updating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class DiagnoseResultLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -class DistributionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job distribution type. - """ - - PY_TORCH = "PyTorch" - TENSOR_FLOW = "TensorFlow" - MPI = "Mpi" - -class EarlyTerminationPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - BANDIT = "Bandit" - MEDIAN_STOPPING = "MedianStopping" - TRUNCATION_SELECTION = "TruncationSelection" - -class EgressPublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EmailNotificationEnableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the email notification type. - """ - - JOB_COMPLETED = "JobCompleted" - JOB_FAILED = "JobFailed" - JOB_CANCELLED = "JobCancelled" - -class EncryptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class EndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ - - AML_TOKEN = "AMLToken" - KEY = "Key" - AAD_TOKEN = "AADToken" - -class EndpointComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint compute type. - """ - - MANAGED = "Managed" - KUBERNETES = "Kubernetes" - AZURE_ML_COMPUTE = "AzureMLCompute" - -class EndpointProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of endpoint provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class EndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Connection status of the service consumer with the service provider - """ - - APPROVED = "Approved" - PENDING = "Pending" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - TIMEOUT = "Timeout" - -class EndpointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the endpoint. - """ - - AZURE_OPEN_AI = "Azure.OpenAI" - AZURE_SPEECH = "Azure.Speech" - AZURE_CONTENT_SAFETY = "Azure.ContentSafety" - AZURE_LLAMA = "Azure.Llama" - MANAGED_ONLINE_ENDPOINT = "managedOnlineEndpoint" - SERVERLESS_ENDPOINT = "serverlessEndpoint" - -class EnvironmentType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Environment type is either user created or curated by Azure ML service - """ - - CURATED = "Curated" - USER_CREATED = "UserCreated" - -class EnvironmentVariableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class FeatureAttributionMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" - -class FeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - STRING = "String" - INTEGER = "Integer" - LONG = "Long" - FLOAT = "Float" - DOUBLE = "Double" - BINARY = "Binary" - DATETIME = "Datetime" - BOOLEAN = "Boolean" - -class FeatureImportanceMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The mode of operation for computing feature importance. - """ - - #: Disables computing feature importance within a signal. - DISABLED = "Disabled" - #: Enables computing feature importance within a signal. - ENABLED = "Enabled" - -class FeatureLags(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Flag for generating lags for the numeric features. - """ - - #: No feature lags generated. - NONE = "None" - #: System auto-generates feature lags. - AUTO = "Auto" - -class FeaturizationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Featurization mode - determines data featurization mode. - """ - - #: Auto mode, system performs featurization without any custom featurization inputs. - AUTO = "Auto" - #: Custom featurization. - CUSTOM = "Custom" - #: Featurization off. 'Forecasting' task cannot use this value. - OFF = "Off" - -class FineTuningTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CHAT_COMPLETION = "ChatCompletion" - TEXT_COMPLETION = "TextCompletion" - TEXT_CLASSIFICATION = "TextClassification" - QUESTION_ANSWERING = "QuestionAnswering" - TEXT_SUMMARIZATION = "TextSummarization" - TOKEN_CLASSIFICATION = "TokenClassification" - TEXT_TRANSLATION = "TextTranslation" - IMAGE_CLASSIFICATION = "ImageClassification" - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - VIDEO_MULTI_OBJECT_TRACKING = "VideoMultiObjectTracking" - -class FirewallSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Firewall Sku used for FQDN Rules - """ - - STANDARD = "Standard" - BASIC = "Basic" - -class ForecastHorizonMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine forecast horizon selection mode. - """ - - #: Forecast horizon to be determined automatically. - AUTO = "Auto" - #: Use the custom forecast horizon. - CUSTOM = "Custom" - -class ForecastingModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all forecasting models supported by AutoML. - """ - - #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - #: statistical analysis to interpret the data and make future predictions. - #: This model aims to explain data by using time series data on its past values and uses linear - #: regression to make predictions. - AUTO_ARIMA = "AutoArima" - #: Prophet is a procedure for forecasting time series data based on an additive model where - #: non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. - #: It works best with time series that have strong seasonal effects and several seasons of - #: historical data. Prophet is robust to missing data and shifts in the trend, and typically - #: handles outliers well. - PROPHET = "Prophet" - #: The Naive forecasting model makes predictions by carrying forward the latest target value for - #: each time-series in the training data. - NAIVE = "Naive" - #: The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - #: target values for each time-series in the training data. - SEASONAL_NAIVE = "SeasonalNaive" - #: The Average forecasting model makes predictions by carrying forward the average of the target - #: values for each time-series in the training data. - AVERAGE = "Average" - #: The Seasonal Average forecasting model makes predictions by carrying forward the average value - #: of the latest season of data for each time-series in the training data. - SEASONAL_AVERAGE = "SeasonalAverage" - #: Exponential smoothing is a time series forecasting method for univariate data that can be - #: extended to support data with a systematic trend or seasonal component. - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - #: An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - #: viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - #: more moving average (MA) terms. - #: This method is suitable for forecasting when data is stationary/non stationary, and - #: multivariate with any type of data pattern, i.e., level/trend /seasonality/cyclicity. - ARIMAX = "Arimax" - #: TCNForecaster: Temporal Convolutional Networks Forecaster. //TODO: Ask forecasting team for - #: brief intro. - TCN_FORECASTER = "TCNForecaster" - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the "bagging" - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class ForecastingPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Forecasting task. - """ - - #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class Goal(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Defines supported metric goals for hyperparameter tuning - """ - - MINIMIZE = "Minimize" - MAXIMIZE = "Maximize" - -class IdentityConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine identity framework. - """ - - MANAGED = "Managed" - AML_TOKEN = "AMLToken" - USER_IDENTITY = "UserIdentity" - -class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - Environment images (custom and curated) - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class InputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the input data delivery mode. - """ - - READ_ONLY_MOUNT = "ReadOnlyMount" - READ_WRITE_MOUNT = "ReadWriteMount" - DOWNLOAD = "Download" - DIRECT = "Direct" - EVAL_MOUNT = "EvalMount" - EVAL_DOWNLOAD = "EvalDownload" - -class InstanceSegmentationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for InstanceSegmentation tasks. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class IsolationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Isolation mode for the managed network of a machine learning workspace. - """ - - DISABLED = "Disabled" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - -class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Input Type. - """ - - LITERAL = "literal" - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobLimitsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Output Type. - """ - - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status of a job. - """ - - #: Run hasn't started yet. - NOT_STARTED = "NotStarted" - #: Run has started. The user has a run ID. - STARTING = "Starting" - #: (Not used currently) It will be used if ES is creating the compute target. - PROVISIONING = "Provisioning" - #: The run environment is being prepared. - PREPARING = "Preparing" - #: The job is queued in the compute target. For example, in BatchAI the job is in queued state, - #: while waiting for all required nodes to be ready. - QUEUED = "Queued" - #: The job started to run in the compute target. - RUNNING = "Running" - #: Job is completed in the target. It is in output collection state now. - FINALIZING = "Finalizing" - #: Cancellation has been requested for the job. - CANCEL_REQUESTED = "CancelRequested" - #: Job completed successfully. This reflects that both the job itself and output collection states - #: completed successfully. - COMPLETED = "Completed" - #: Job failed. - FAILED = "Failed" - #: Following cancellation request, the job is now successfully canceled. - CANCELED = "Canceled" - #: When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - #: goes to NotResponding state. - #: NotResponding is the only state that is exempt from strict transition orders. A run can go from - #: NotResponding to any of the previous states. - NOT_RESPONDING = "NotResponding" - #: The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. - PAUSED = "Paused" - #: Default job status if not mapped to all other statuses. - UNKNOWN = "Unknown" - -class JobTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job tier. - """ - - NULL = "Null" - SPOT = "Spot" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of job. - """ - - AUTO_ML = "AutoML" - COMMAND = "Command" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - FINE_TUNING = "FineTuning" - DISTILLATION = "Distillation" - -class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - PRIMARY = "Primary" - SECONDARY = "Secondary" - -class LearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Learning rate scheduler enum. - """ - - #: No learning rate scheduler selected. - NONE = "None" - #: Cosine Annealing With Warmup. - WARMUP_COSINE = "WarmupCosine" - #: Step learning rate scheduler. - STEP = "Step" - -class ListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ACTIVE_ONLY = "ActiveOnly" - ARCHIVED_ONLY = "ArchivedOnly" - ALL = "All" - -class LoadBalancerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -class LogVerbosity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for setting log verbosity. - """ - - #: No logs emitted. - NOT_SET = "NotSet" - #: Debug and above log statements logged. - DEBUG = "Debug" - #: Info and above log statements logged. - INFO = "Info" - #: Warning and above log statements logged. - WARNING = "Warning" - #: Error and above log statements logged. - ERROR = "Error" - #: Only critical statements logged. - CRITICAL = "Critical" - -class ManagedNetworkStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status for the managed network of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class ManagedPERequirement(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - REQUIRED = "Required" - NOT_REQUIRED = "NotRequired" - NOT_APPLICABLE = "NotApplicable" - -class ManagedPEStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - INACTIVE = "Inactive" - ACTIVE = "Active" - NOT_APPLICABLE = "NotApplicable" - -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class MarketplaceSubscriptionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: MarketplaceSubscription is being created. - CREATING = "Creating" - #: MarketplaceSubscription is being deleted. - DELETING = "Deleting" - #: MarketplaceSubscription is successfully provisioned. - SUCCEEDED = "Succeeded" - #: MarketplaceSubscription provisioning failed. - FAILED = "Failed" - #: MarketplaceSubscription is being updated. - UPDATING = "Updating" - CANCELED = "Canceled" - -class MarketplaceSubscriptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The customer can now use the Marketplace Subscription's - #: model and will be billed. - SUBSCRIBED = "Subscribed" - #: The customer could not be billed for the Marketplace Subscription. - #: The customer will not be able to access the model. - SUSPENDED = "Suspended" - #: Marketplace Subscriptions reach this state in response to an explicit customer or CSP action. - #: A Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, - #: after being in the Suspended state for some time. - UNSUBSCRIBED = "Unsubscribed" - -class MaterializationStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - -class MlflowAutologger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ModelLifecycleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model lifecycle status. - """ - - GENERALLY_AVAILABLE = "GenerallyAvailable" - PREVIEW = "Preview" - -class ModelProvider(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of fine tuning. - """ - - #: Fine tuning using Azure Open AI model. - AZURE_OPEN_AI = "AzureOpenAI" - #: Fine tuning using custom model. - CUSTOM = "Custom" - -class ModelSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Image model size. - """ - - #: No value selected. - NONE = "None" - #: Small size. - SMALL = "Small" - #: Medium size. - MEDIUM = "Medium" - #: Large size. - LARGE = "Large" - #: Extra large size. - EXTRA_LARGE = "ExtraLarge" - -class ModelTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model task type enum. - """ - - CLASSIFICATION = "Classification" - REGRESSION = "Regression" - -class MonitorComputeIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute identity type enum. - """ - - #: Authenticates through user's AML token. - AML_TOKEN = "AmlToken" - #: Authenticates through a user-provided managed identity. - MANAGED_IDENTITY = "ManagedIdentity" - -class MonitorComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute type enum. - """ - - #: Serverless Spark compute. - SERVERLESS_SPARK = "ServerlessSpark" - -class MonitoringFeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Used for features of numerical data type. - NUMERICAL = "Numerical" - #: Used for features of categorical data type. - CATEGORICAL = "Categorical" - -class MonitoringFeatureFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Includes all features. - ALL_FEATURES = "AllFeatures" - #: Only includes the top contributing features, measured by feature attribution. - TOP_N_BY_ATTRIBUTION = "TopNByAttribution" - #: Includes a user-defined subset of features. - FEATURE_SUBSET = "FeatureSubset" - -class MonitoringInputDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitoring input data type enum. - """ - - #: An input data with a fixed window size. - STATIC = "Static" - #: An input data which rolls relatively to the monitor's current run time. - ROLLING = "Rolling" - #: An input data with tabular format which doesn't require preprocessing. - FIXED = "Fixed" - -class MonitoringNotificationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enables email notifications through AML notifications. - AML_NOTIFICATION = "AmlNotification" - -class MonitoringSignalType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Tracks model input data distribution change, comparing against training data or past production - #: data. - DATA_DRIFT = "DataDrift" - #: Tracks prediction result data distribution change, comparing against validation/test label data - #: or past production data. - PREDICTION_DRIFT = "PredictionDrift" - #: Tracks model input data integrity. - DATA_QUALITY = "DataQuality" - #: Tracks feature importance change in production, comparing against feature importance at - #: training time. - FEATURE_ATTRIBUTION_DRIFT = "FeatureAttributionDrift" - #: Tracks a custom signal provided by users. - CUSTOM = "Custom" - -class MountAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Mode. - """ - - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -class MountState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -class NCrossValidationsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Determines how N-Cross validations value is determined. - """ - - #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - #: task. - AUTO = "Auto" - #: Use custom N-Cross validations value. - CUSTOM = "Custom" - -class Network(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NodeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - RUNNING = "running" - PREPARING = "preparing" - UNUSABLE = "unusable" - LEAVING = "leaving" - PREEMPTED = "preempted" - -class NodesValueType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated types for the nodes value - """ - - ALL = "All" - -class NumericalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class NumericalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the rate of null values. - NULL_VALUE_RATE = "NullValueRate" - #: Calculates the rate of data type errors. - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - #: Calculates the rate values are out of bounds. - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - -class NumericalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Jensen Shannon Distance (JSD) metric. - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - #: The Population Stability Index (PSI) metric. - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - #: The Normalized Wasserstein Distance metric. - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - -class ObjectDetectionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Image ObjectDetection task. - """ - - #: Mean Average Precision (MAP) is the average of AP (Average Precision). - #: AP is calculated for each class and averaged to get the MAP. - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - -class OneLakeArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine OneLake artifact type. - """ - - LAKE_HOUSE = "LakeHouse" - -class OperatingSystemType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of operating system. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OperationName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Name of the last operation. - """ - - CREATE = "Create" - START = "Start" - STOP = "Stop" - RESTART = "Restart" - RESIZE = "Resize" - REIMAGE = "Reimage" - DELETE = "Delete" - -class OperationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operation status. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CREATE_FAILED = "CreateFailed" - START_FAILED = "StartFailed" - STOP_FAILED = "StopFailed" - RESTART_FAILED = "RestartFailed" - RESIZE_FAILED = "ResizeFailed" - REIMAGE_FAILED = "ReimageFailed" - DELETE_FAILED = "DeleteFailed" - -class OperationTrigger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class Origin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - -class OsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -class PatchStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The os patching status. - """ - - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - UNKNOWN = "Unknown" - -class PendingUploadCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the PendingUpload credentials type. - """ - - SAS = "SAS" - -class PendingUploadType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of storage to use for the pending upload location - """ - - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - -class PoolProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of pool related resources provisioning. - """ - - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - UPDATING = "Updating" - CANCELED = "Canceled" - -class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - -class Protocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, - Succeeded, and Failed. - """ - - UNKNOWN = "Unknown" - UPDATING = "Updating" - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -class RaiPolicyContentSource(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content source to apply the Content Filters. - """ - - PROMPT = "Prompt" - COMPLETION = "Completion" - -class RaiPolicyMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content Filters mode. - """ - - DEFAULT = "Default" - DEFERRED = "Deferred" - BLOCKING = "Blocking" - -class RaiPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Content Filters policy type. - """ - - USER_MANAGED = "UserManaged" - SYSTEM_MANAGED = "SystemManaged" - -class RandomSamplingAlgorithmRule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The specific type of random algorithm - """ - - RANDOM = "Random" - SOBOL = "Sobol" - -class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a recurrence schedule - """ - - #: Minute frequency. - MINUTE = "Minute" - #: Hour frequency. - HOUR = "Hour" - #: Day frequency. - DAY = "Day" - #: Week frequency. - WEEK = "Week" - #: Month frequency. - MONTH = "Month" - -class ReferenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine which reference method to use for an asset. - """ - - ID = "Id" - DATA_PATH = "DataPath" - OUTPUT_PATH = "OutputPath" - -class RegressionModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all Regression models supported by AutoML. - """ - - #: Elastic net is a popular type of regularized linear regression that combines two popular - #: penalties, specifically the L1 and L2 penalty functions. - ELASTIC_NET = "ElasticNet" - #: The technique of transiting week learners into a strong learner is called Boosting. The - #: gradient boosting algorithm process works on this theory of execution. - GRADIENT_BOOSTING = "GradientBoosting" - #: Decision Trees are a non-parametric supervised learning method used for both classification and - #: regression tasks. - #: The goal is to create a model that predicts the value of a target variable by learning simple - #: decision rules inferred from the data features. - DECISION_TREE = "DecisionTree" - #: K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - #: datapoints - #: which further means that the new data point will be assigned a value based on how closely it - #: matches the points in the training set. - KNN = "KNN" - #: Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - #: L1 prior as regularizer. - LASSO_LARS = "LassoLars" - #: SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - #: applications - #: to find the model parameters that correspond to the best fit between predicted and actual - #: outputs. - #: It's an inexact but powerful technique. - SGD = "SGD" - #: Random forest is a supervised learning algorithm. - #: The "forest" it builds, is an ensemble of decision trees, usually trained with the "bagging" - #: method. - #: The general idea of the bagging method is that a combination of learning models increases the - #: overall result. - RANDOM_FOREST = "RandomForest" - #: Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - #: decision trees. It is related to the widely used random forest algorithm. - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - #: LightGBM is a gradient boosting framework that uses tree based learning algorithms. - LIGHT_GBM = "LightGBM" - #: XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - #: using ensemble of base learners. - XG_BOOST_REGRESSOR = "XGBoostRegressor" - -class RegressionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Regression task. - """ - - #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. - SPEARMAN_CORRELATION = "SpearmanCorrelation" - #: The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - #: models with different scales. - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - #: The R2 score is one of the performance evaluation measures for forecasting-based machine - #: learning models. - R2_SCORE = "R2Score" - #: The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - #: Error (MAE) of (time) series with different scales. - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - -class RemoteLoginPortPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_SPECIFIED = "NotSpecified" - -class RollingRateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - YEAR = "Year" - MONTH = "Month" - DAY = "Day" - HOUR = "Hour" - MINUTE = "Minute" - -class RuleAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The action enum for networking rule. - """ - - ALLOW = "Allow" - DENY = "Deny" - -class RuleCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ - - REQUIRED = "Required" - RECOMMENDED = "Recommended" - USER_DEFINED = "UserDefined" - DEPENDENCY = "Dependency" - -class RuleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class RuleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - FQDN = "FQDN" - PRIVATE_ENDPOINT = "PrivateEndpoint" - SERVICE_TAG = "ServiceTag" - -class SamplingAlgorithmType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - CREATE_MONITOR = "CreateMonitor" - -class ScheduleListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SeasonalityMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Forecasting seasonality mode. - """ - - #: Seasonality to be determined automatically. - AUTO = "Auto" - #: Use the custom seasonality value. - CUSTOM = "Custom" - -class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore secrets type. - """ - - ACCOUNT_KEY = "AccountKey" - CERTIFICATE = "Certificate" - SAS = "Sas" - SERVICE_PRINCIPAL = "ServicePrincipal" - -class ServerlessEndpointState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the Serverless Endpoint. - """ - - UNKNOWN = "Unknown" - CREATING = "Creating" - DELETING = "Deleting" - SUSPENDING = "Suspending" - REINSTATING = "Reinstating" - ONLINE = "Online" - SUSPENDED = "Suspended" - CREATION_FAILED = "CreationFailed" - DELETION_FAILED = "DeletionFailed" - -class ServerlessInferenceEndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY = "Key" - AAD = "AAD" - KEY_AND_AAD = "KeyAndAAD" - -class ServiceAccountKeyName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - KEY1 = "Key1" - KEY2 = "Key2" - -class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Do not use any identity for service data access. - NONE = "None" - #: Use the system assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - #: Use the user assigned managed identity of the Workspace to authenticate service data access. - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - -class ShortSeriesHandlingConfiguration(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The parameter defining how if AutoML should handle short time series. - """ - - #: Represents no/null value. - NONE = "None" - #: Short series will be padded if there are no long series, otherwise short series will be - #: dropped. - AUTO = "Auto" - #: All the short series will be padded. - PAD = "Pad" - #: All the short series will be dropped. - DROP = "Drop" - -class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Node scaling setting for the compute sku. - """ - - #: Automatically scales node count. - AUTOMATIC = "Automatic" - #: Node count scaled upon user request. - MANUAL = "Manual" - #: Fixed set of nodes. - NONE = "None" - -class SkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - -class SourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -class SshPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SslConfigStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - AUTO = "Auto" - -class StackMetaLearnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). - This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression - """ - - NONE = "None" - #: Default meta-learners are LogisticRegression for classification tasks. - LOGISTIC_REGRESSION = "LogisticRegression" - #: Default meta-learners are LogisticRegression for classification task when CV is on. - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - #: Default meta-learners are LogisticRegression for regression task. - ELASTIC_NET = "ElasticNet" - #: Default meta-learners are LogisticRegression for regression task when CV is on. - ELASTIC_NET_CV = "ElasticNetCV" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - LINEAR_REGRESSION = "LinearRegression" - -class Status(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status of update workspace quota. - """ - - UNDEFINED = "Undefined" - SUCCESS = "Success" - FAILURE = "Failure" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - -class StochasticOptimizer(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Stochastic optimizer for image models. - """ - - #: No optimizer selected. - NONE = "None" - #: Stochastic Gradient Descent optimizer. - SGD = "Sgd" - #: Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - #: moments. - ADAM = "Adam" - #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. - ADAMW = "Adamw" - -class StorageAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -class SystemDatastoresAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The auth mode used for accessing the system datastores of the workspace. - """ - - ACCESS_KEY = "AccessKey" - IDENTITY = "Identity" - USER_DELEGATION_SAS = "UserDelegationSAS" - -class TargetAggregationFunction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target aggregate function. - """ - - #: Represent no value set. - NONE = "None" - SUM = "Sum" - MAX = "Max" - MIN = "Min" - MEAN = "Mean" - -class TargetLagsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target lags selection modes. - """ - - #: Target lags to be determined automatically. - AUTO = "Auto" - #: Use the custom target lags. - CUSTOM = "Custom" - -class TargetRollingWindowSizeMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target rolling windows size mode. - """ - - #: Determine rolling windows size automatically. - AUTO = "Auto" - #: Use the specified rolling window size. - CUSTOM = "Custom" - -class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoMLJob Task type. - """ - - #: Classification in machine learning and statistics is a supervised learning approach in which - #: the computer program learns from the data given to it and make new observations or - #: classifications. - CLASSIFICATION = "Classification" - #: Regression means to predict the value using the input data. Regression models are used to - #: predict a continuous value. - REGRESSION = "Regression" - #: Forecasting is a special kind of regression task that deals with time-series data and creates - #: forecasting model - #: that can be used to predict the near future values based on the inputs. - FORECASTING = "Forecasting" - #: Image Classification. Multi-class image classification is used when an image is classified with - #: only a single label - #: from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - #: or a 'duck'. - IMAGE_CLASSIFICATION = "ImageClassification" - #: Image Classification Multilabel. Multi-label image classification is used when an image could - #: have one or more labels - #: from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - #: Image Object Detection. Object detection is used to identify objects in an image and locate - #: each object with a - #: bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - #: Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - #: the pixel level, - #: drawing a polygon around each object in the image. - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - #: Text classification (also known as text tagging or text categorization) is the process of - #: sorting texts into categories. - #: Categories are mutually exclusive. - TEXT_CLASSIFICATION = "TextClassification" - #: Multilabel classification task assigns each sample to a group (zero or more) of target labels. - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - #: Text Named Entity Recognition a.k.a. TextNER. - #: Named Entity Recognition (NER) is the ability to take free-form text and identify the - #: occurrences of entities such as people, locations, organizations, and more. - TEXT_NER = "TextNER" - -class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class UnderlyingResourceAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - DELETE = "Delete" - DETACH = "Detach" - -class UnitOfMeasure(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The unit of time measurement for the specified VM price. Example: OneHour - """ - - ONE_HOUR = "OneHour" - -class UsageUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of usage measurement. - """ - - COUNT = "Count" - -class UseStl(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Configure STL Decomposition of the time-series target column. - """ - - #: No stl decomposition. - NONE = "None" - SEASON = "Season" - SEASON_TREND = "SeasonTrend" - -class ValidationMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Metric computation method to use for validation metrics in image tasks. - """ - - #: No metric. - NONE = "None" - #: Coco metric. - COCO = "Coco" - #: Voc metric. - VOC = "Voc" - #: CocoVoc metric. - COCO_VOC = "CocoVoc" - -class VMPriceOSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operating system type used by the VM. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class VmPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Virtual Machine priority - """ - - DEDICATED = "Dedicated" - LOW_PRIORITY = "LowPriority" - -class VMTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of the VM. - """ - - STANDARD = "Standard" - LOW_PRIORITY = "LowPriority" - SPOT = "Spot" - -class VolumeDefinitionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class VulnerabilityRisk(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - UNKNOWN = "UNKNOWN" - CRITICAL = "CRITICAL" - HIGH = "HIGH" - MEDIUM = "MEDIUM" - LOW = "LOW" - -class WebhookType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the webhook callback service type. - """ - - AZURE_DEV_OPS = "AzureDevOps" - -class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ - - #: Monday weekday. - MONDAY = "Monday" - #: Tuesday weekday. - TUESDAY = "Tuesday" - #: Wednesday weekday. - WEDNESDAY = "Wednesday" - #: Thursday weekday. - THURSDAY = "Thursday" - #: Friday weekday. - FRIDAY = "Friday" - #: Saturday weekday. - SATURDAY = "Saturday" - #: Sunday weekday. - SUNDAY = "Sunday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models.py deleted file mode 100644 index e5fafd22c1aa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models.py +++ /dev/null @@ -1,34035 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.created_by_workspace_arm_id = None - self.error = kwargs.get('error', None) - self.expiry_time = kwargs.get('expiry_time', None) - self.group = None - self.is_shared_to_all = kwargs.get('is_shared_to_all', None) - self.metadata = kwargs.get('metadata', None) - self.pe_requirement = kwargs.get('pe_requirement', None) - self.pe_status = kwargs.get('pe_status', None) - self.shared_user_list = kwargs.get('shared_user_list', None) - self.target = kwargs.get('target', None) - self.use_workspace_managed_identity = kwargs.get('use_workspace_managed_identity', None) - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Account key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccountKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Account key object for workspace connection credential. - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar total: Gets or sets the total number of instances (scale units) regardless of - provisioning state or whether current group payload version matches the target group payload. - :vartype total: int - :ivar succeeded: Gets or sets the number of instances (scale units) which have Succeeded - provisioning state and target group payload. - :vartype succeeded: int - :ivar failed: Gets or sets the number of instances (scale units) which have Failed provisioning - state and have target group payload. - :vartype failed: int - :ivar outdated_succeeded: Gets or sets the number of instances (scale units) which have - Succeeded provisioning state but do not have target group payload. - :vartype outdated_succeeded: int - :ivar outdated_failed: Gets or sets the number of instances (scale units) which have Failed - provisioning state but do not have target group payload. - :vartype outdated_failed: int - """ - - _attribute_map = { - 'total': {'key': 'total', 'type': 'int'}, - 'succeeded': {'key': 'succeeded', 'type': 'int'}, - 'failed': {'key': 'failed', 'type': 'int'}, - 'outdated_succeeded': {'key': 'outdatedSucceeded', 'type': 'int'}, - 'outdated_failed': {'key': 'outdatedFailed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword total: Gets or sets the total number of instances (scale units) regardless of - provisioning state or whether current group payload version matches the target group payload. - :paramtype total: int - :keyword succeeded: Gets or sets the number of instances (scale units) which have Succeeded - provisioning state and target group payload. - :paramtype succeeded: int - :keyword failed: Gets or sets the number of instances (scale units) which have Failed - provisioning state and have target group payload. - :paramtype failed: int - :keyword outdated_succeeded: Gets or sets the number of instances (scale units) which have - Succeeded provisioning state but do not have target group payload. - :paramtype outdated_succeeded: int - :keyword outdated_failed: Gets or sets the number of instances (scale units) which have Failed - provisioning state but do not have target group payload. - :paramtype outdated_failed: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.total = kwargs.get('total', 0) - self.succeeded = kwargs.get('succeeded', 0) - self.failed = kwargs.get('failed', 0) - self.outdated_succeeded = kwargs.get('outdated_succeeded', 0) - self.outdated_failed = kwargs.get('outdated_failed', 0) - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) - self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, DistillationJob, FineTuningJob, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Distillation': 'DistillationJob', 'FineTuning': 'FineTuningJob', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = kwargs.get('notification_setting', None) - self.parent_job_name = kwargs.get('parent_job_name', None) - self.services = kwargs.get('services', None) - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AvailableQuota(msrest.serialization.Model): - """AvailableQuota. - - :ivar properties: Available quota properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AvailableQuotaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AvailableQuotaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Available quota properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AvailableQuotaProperties - """ - super(AvailableQuota, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AvailableQuotaArmPaginatedResult(msrest.serialization.Model): - """A paginated list of AvailableQuota entities. - - :ivar next_link: The link to the next page of AvailableQuota objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type AvailableQuota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AvailableQuota] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[AvailableQuota]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of AvailableQuota objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type AvailableQuota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AvailableQuota] - """ - super(AvailableQuotaArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class AvailableQuotaProperties(msrest.serialization.Model): - """AvailableQuotaProperties. - - :ivar total: The number of available quota. - :vartype total: long - """ - - _attribute_map = { - 'total': {'key': 'total', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword total: The number of available quota. - :paramtype total: long - """ - super(AvailableQuotaProperties, self).__init__(**kwargs) - self.total = kwargs.get('total', None) - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = kwargs.get('event_type', None) - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(**kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.is_default = None - - -class FineTuningVertical(msrest.serialization.Model): - """FineTuningVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOpenAiFineTuning, CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'JobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - _subtype_map = { - 'model_provider': {'AzureOpenAI': 'AzureOpenAiFineTuning', 'Custom': 'CustomModelFineTuning'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FineTuningVertical, self).__init__(**kwargs) - self.model = kwargs['model'] - self.model_provider = None # type: Optional[str] - self.task_type = kwargs['task_type'] - self.training_data = kwargs['training_data'] - self.validation_data = kwargs.get('validation_data', None) - - -class AzureOpenAiFineTuning(FineTuningVertical): - """AzureOpenAiFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :vartype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'JobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': 'AzureOpenAiHyperParameters'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :paramtype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - super(AzureOpenAiFineTuning, self).__init__(**kwargs) - self.model_provider = 'AzureOpenAI' # type: str - self.hyper_parameters = kwargs.get('hyper_parameters', None) - - -class AzureOpenAiHyperParameters(msrest.serialization.Model): - """Azure Open AI hyperparameters for fine tuning. - - :ivar batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :vartype batch_size: int - :ivar learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning rate - may be useful to avoid over fitting. - :vartype learning_rate_multiplier: float - :ivar n_epochs: The number of epochs to train the model for. An epoch refers to one full cycle - through the training dataset. - :vartype n_epochs: int - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'learning_rate_multiplier': {'key': 'learningRateMultiplier', 'type': 'float'}, - 'n_epochs': {'key': 'nEpochs', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :paramtype batch_size: int - :keyword learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning - rate may be useful to avoid over fitting. - :paramtype learning_rate_multiplier: float - :keyword n_epochs: The number of epochs to train the model for. An epoch refers to one full - cycle through the training dataset. - :paramtype n_epochs: int - """ - super(AzureOpenAiHyperParameters, self).__init__(**kwargs) - self.batch_size = kwargs.get('batch_size', None) - self.learning_rate_multiplier = kwargs.get('learning_rate_multiplier', None) - self.n_epochs = kwargs.get('n_epochs', None) - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.deployment_configuration = kwargs.get('deployment_configuration', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") - self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] The authentication method for invoking the endpoint (data - plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine - Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] The authentication method for invoking the endpoint - (data plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure - Machine Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] The authentication method for invoking the endpoint (data - plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine - Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] The authentication method for invoking the endpoint - (data plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure - Machine Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = kwargs.get('component_id', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.tags = kwargs.get('tags', None) - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CapabilityHost(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CapabilityHostProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties - """ - super(CapabilityHost, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CapabilityHostProperties(ResourceBase): - """CapabilityHostProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar ai_services_connections: List of AI services connections. - :vartype ai_services_connections: list[str] - :ivar capability_host_kind: Kind of this capability host. Possible values include: "Agents". - :vartype capability_host_kind: str or - ~azure.mgmt.machinelearningservices.models.CapabilityHostKind - :ivar customer_subnet: Customer subnet info to help set up this capability host. - :vartype customer_subnet: str - :ivar provisioning_state: Provisioning state for the CapabilityHost. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.CapabilityHostProvisioningState - :ivar storage_connections: List of Storage connections. - :vartype storage_connections: list[str] - :ivar thread_storage_connections: List of Thread storage connections. - :vartype thread_storage_connections: list[str] - :ivar vector_store_connections: List of VectorStore connections. - :vartype vector_store_connections: list[str] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'ai_services_connections': {'key': 'aiServicesConnections', 'type': '[str]'}, - 'capability_host_kind': {'key': 'capabilityHostKind', 'type': 'str'}, - 'customer_subnet': {'key': 'customerSubnet', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'storage_connections': {'key': 'storageConnections', 'type': '[str]'}, - 'thread_storage_connections': {'key': 'threadStorageConnections', 'type': '[str]'}, - 'vector_store_connections': {'key': 'vectorStoreConnections', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword ai_services_connections: List of AI services connections. - :paramtype ai_services_connections: list[str] - :keyword capability_host_kind: Kind of this capability host. Possible values include: "Agents". - :paramtype capability_host_kind: str or - ~azure.mgmt.machinelearningservices.models.CapabilityHostKind - :keyword customer_subnet: Customer subnet info to help set up this capability host. - :paramtype customer_subnet: str - :keyword storage_connections: List of Storage connections. - :paramtype storage_connections: list[str] - :keyword thread_storage_connections: List of Thread storage connections. - :paramtype thread_storage_connections: list[str] - :keyword vector_store_connections: List of VectorStore connections. - :paramtype vector_store_connections: list[str] - """ - super(CapabilityHostProperties, self).__init__(**kwargs) - self.ai_services_connections = kwargs.get('ai_services_connections', None) - self.capability_host_kind = kwargs.get('capability_host_kind', None) - self.customer_subnet = kwargs.get('customer_subnet', None) - self.provisioning_state = None - self.storage_connections = kwargs.get('storage_connections', None) - self.thread_storage_connections = kwargs.get('thread_storage_connections', None) - self.vector_store_connections = kwargs.get('vector_store_connections', None) - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = kwargs.get('minimum', None) - self.maximum = kwargs.get('maximum', None) - self.step = kwargs.get('step', None) - self.default = kwargs.get('default', None) - self.allowed_values = kwargs.get('allowed_values', None) - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.data_collection_mode = kwargs.get('data_collection_mode', None) - self.data_id = kwargs.get('data_id', None) - self.sampling_rate = kwargs.get('sampling_rate', 1) - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) - self.parameters = None - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - self.provisioning_state = None - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.mount_mode = kwargs.get('mount_mode', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.enable_os_patching = kwargs.get('enable_os_patching', False) - self.enable_root_access = kwargs.get('enable_root_access', True) - self.enable_sso = kwargs.get('enable_sso', True) - self.release_quota_on_stop = kwargs.get('release_quota_on_stop', False) - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) - self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) - - -class ContentSafety(msrest.serialization.Model): - """ContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_level: [Required] Specifies the current safety level for content safety. - Possible values include: "Blocking", "Deferred". - :vartype content_safety_level: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyLevel - :ivar content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_level': {'key': 'contentSafetyLevel', 'type': 'str'}, - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content_safety_level: [Required] Specifies the current safety level for content - safety. Possible values include: "Blocking", "Deferred". - :paramtype content_safety_level: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyLevel - :keyword content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ContentSafety, self).__init__(**kwargs) - self.content_safety_level = kwargs.get('content_safety_level', None) - self.content_safety_status = kwargs['content_safety_status'] - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties, ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties', 'serverlessEndpoint': 'ServerlessEndpointResourceProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = kwargs.get('associated_resource_id', None) - self.deployments = kwargs.get('deployments', None) - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = kwargs.get('endpoint_uri', None) - self.failure_reason = kwargs.get('failure_reason', None) - self.location = kwargs.get('location', None) - self.name = kwargs.get('name', None) - self.provisioning_state = None - self.should_create_ai_services_endpoint = kwargs.get('should_create_ai_services_endpoint', None) - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = kwargs['monitor_definition'] - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = kwargs.get('credentials', None) - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class CustomModelFineTuning(FineTuningVertical): - """CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning custom model. - :vartype hyper_parameters: dict[str, str] - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'JobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning custom model. - :paramtype hyper_parameters: dict[str, str] - """ - super(CustomModelFineTuning, self).__init__(**kwargs) - self.model_provider = 'Custom' # type: str - self.hyper_parameters = kwargs.get('hyper_parameters', None) - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = kwargs.get('notification_types', None) - self.properties = kwargs.get('properties', None) - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] Reference to the component asset used to calculate the - custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] Reference to the component asset used to calculate - the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - super(CustomMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = kwargs['component_id'] - self.input_assets = kwargs.get('input_assets', None) - self.inputs = kwargs.get('inputs', None) - self.metric_thresholds = kwargs['metric_thresholds'] - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) - self.kernel = kwargs.get('kernel', None) - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.request_logging = kwargs.get('request_logging', None) - self.rolling_rate = kwargs.get('rolling_rate', None) - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataGenerationVertical(msrest.serialization.Model): - """DataGenerationVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelGeneration. - - All required parameters must be populated in order to send to Azure. - - :ivar data_generation_task_type: Required. [Required] DataGeneration Task type. Possible values - include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :vartype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :ivar data_generation_type: Required. [Required] Enum to determine the type of Data - Generation.Constant filled by server. Possible values include: "LabelGeneration", - "DataGeneration". - :vartype data_generation_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationType - :ivar prompt_settings: Prompt Settings. - :vartype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :ivar teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :vartype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :ivar teacher_model_settings: - :vartype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - """ - - _validation = { - 'data_generation_task_type': {'required': True}, - 'data_generation_type': {'required': True}, - 'teacher_model_endpoint': {'required': True}, - } - - _attribute_map = { - 'data_generation_task_type': {'key': 'dataGenerationTaskType', 'type': 'str'}, - 'data_generation_type': {'key': 'dataGenerationType', 'type': 'str'}, - 'prompt_settings': {'key': 'promptSettings', 'type': 'PromptSettings'}, - 'teacher_model_endpoint': {'key': 'teacherModelEndpoint', 'type': 'TeacherModelEndpoint'}, - 'teacher_model_settings': {'key': 'teacherModelSettings', 'type': 'TeacherModelSettings'}, - } - - _subtype_map = { - 'data_generation_type': {'LabelGeneration': 'LabelGeneration'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_generation_task_type: Required. [Required] DataGeneration Task type. Possible - values include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :paramtype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :keyword prompt_settings: Prompt Settings. - :paramtype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :keyword teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :paramtype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :keyword teacher_model_settings: - :paramtype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - """ - super(DataGenerationVertical, self).__init__(**kwargs) - self.data_generation_task_type = kwargs['data_generation_task_type'] - self.data_generation_type = None # type: Optional[str] - self.prompt_settings = kwargs.get('prompt_settings', None) - self.teacher_model_endpoint = kwargs['teacher_model_endpoint'] - self.teacher_model_settings = kwargs.get('teacher_model_settings', None) - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs.get('feature_importance_settings', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeltaModelCurrentState(msrest.serialization.Model): - """Contract for DeltaModelCurrentState. - - :ivar count: Gets or sets Count of instances with model. - :vartype count: int - :ivar sample_instance_id: Gets or sets sample of instances with model. - :vartype sample_instance_id: str - :ivar status: Gets or sets status. - :vartype status: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'sample_instance_id': {'key': 'sampleInstanceID', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: Gets or sets Count of instances with model. - :paramtype count: int - :keyword sample_instance_id: Gets or sets sample of instances with model. - :paramtype sample_instance_id: str - :keyword status: Gets or sets status. - :paramtype status: str - """ - super(DeltaModelCurrentState, self).__init__(**kwargs) - self.count = kwargs.get('count', 0) - self.sample_instance_id = kwargs.get('sample_instance_id', None) - self.status = kwargs.get('status', None) - - -class DeltaModelListRequest(msrest.serialization.Model): - """DeltaModelListRequest. - - :ivar count: Gets or sets number of delta models to return. Default: -1, means that all will be - returned. - :vartype count: int - :ivar skip_token: Gets or sets skip token for paginated response. - :vartype skip_token: str - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'skip_token': {'key': 'skipToken', 'type': 'str'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: Gets or sets number of delta models to return. Default: -1, means that all will - be returned. - :paramtype count: int - :keyword skip_token: Gets or sets skip token for paginated response. - :paramtype skip_token: str - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelListRequest, self).__init__(**kwargs) - self.count = kwargs.get('count', -1) - self.skip_token = kwargs.get('skip_token', None) - self.target_base_model = kwargs.get('target_base_model', None) - - -class DeltaModelModifyRequest(msrest.serialization.Model): - """Contract base for DeltaModelChangeRequest. Used for adding or removing. - - :ivar add_delta_models: Gets or sets delta models to remove. - :vartype add_delta_models: list[str] - :ivar remove_delta_models: Gets or sets delta models to remove. - :vartype remove_delta_models: list[str] - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _validation = { - 'add_delta_models': {'unique': True}, - 'remove_delta_models': {'unique': True}, - } - - _attribute_map = { - 'add_delta_models': {'key': 'addDeltaModels', 'type': '[str]'}, - 'remove_delta_models': {'key': 'removeDeltaModels', 'type': '[str]'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword add_delta_models: Gets or sets delta models to remove. - :paramtype add_delta_models: list[str] - :keyword remove_delta_models: Gets or sets delta models to remove. - :paramtype remove_delta_models: list[str] - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelModifyRequest, self).__init__(**kwargs) - self.add_delta_models = kwargs.get('add_delta_models', None) - self.remove_delta_models = kwargs.get('remove_delta_models', None) - self.target_base_model = kwargs.get('target_base_model', None) - - -class DeltaModelStatusRequest(msrest.serialization.Model): - """DeltaModelStatusRequest. - - :ivar delta_models: Gets or sets collection of delta models to retrieve status for. - :vartype delta_models: list[str] - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _attribute_map = { - 'delta_models': {'key': 'deltaModels', 'type': '[str]'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delta_models: Gets or sets collection of delta models to retrieve status for. - :paramtype delta_models: list[str] - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelStatusRequest, self).__init__(**kwargs) - self.delta_models = kwargs.get('delta_models', None) - self.target_base_model = kwargs.get('target_base_model', None) - - -class DeltaModelStatusResponse(msrest.serialization.Model): - """Contract returning to user the delta models. - - :ivar actual_instance_count: Gets or sets actual instance count. - :vartype actual_instance_count: int - :ivar delta_models: Gets or sets dictionary representing modelID and its current state. - :vartype delta_models: dict[str, - list[~azure.mgmt.machinelearningservices.models.DeltaModelCurrentState]] - :ivar expected_instance_count: Gets or sets expected instance count. - :vartype expected_instance_count: int - :ivar revision_id: Gets or sets revision ID. - :vartype revision_id: str - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _attribute_map = { - 'actual_instance_count': {'key': 'actualInstanceCount', 'type': 'int'}, - 'delta_models': {'key': 'deltaModels', 'type': '{[DeltaModelCurrentState]}'}, - 'expected_instance_count': {'key': 'expectedInstanceCount', 'type': 'int'}, - 'revision_id': {'key': 'revisionId', 'type': 'str'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_instance_count: Gets or sets actual instance count. - :paramtype actual_instance_count: int - :keyword delta_models: Gets or sets dictionary representing modelID and its current state. - :paramtype delta_models: dict[str, - list[~azure.mgmt.machinelearningservices.models.DeltaModelCurrentState]] - :keyword expected_instance_count: Gets or sets expected instance count. - :paramtype expected_instance_count: int - :keyword revision_id: Gets or sets revision ID. - :paramtype revision_id: str - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelStatusResponse, self).__init__(**kwargs) - self.actual_instance_count = kwargs.get('actual_instance_count', 0) - self.delta_models = kwargs.get('delta_models', None) - self.expected_instance_count = kwargs.get('expected_instance_count', 0) - self.revision_id = kwargs.get('revision_id', None) - self.target_base_model = kwargs.get('target_base_model', None) - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = kwargs.get('destination_name', None) - self.destination_version = kwargs.get('destination_version', None) - self.registry_name = kwargs.get('registry_name', None) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.key_vault = kwargs.get('key_vault', None) - self.nsg = kwargs.get('nsg', None) - self.others = kwargs.get('others', None) - self.required_resource_providers = kwargs.get('required_resource_providers', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.storage_account = kwargs.get('storage_account', None) - self.udr = kwargs.get('udr', None) - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DistillationJob(JobBaseProperties): - """Distillation Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar data_generation_details: Required. [Required]. - :vartype data_generation_details: - ~azure.mgmt.machinelearningservices.models.DataGenerationVertical - :ivar finetuning_details: Required. [Required]. - :vartype finetuning_details: ~azure.mgmt.machinelearningservices.models.FinetuningDetails - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Instance types and other resources for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'data_generation_details': {'required': True}, - 'finetuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'data_generation_details': {'key': 'dataGenerationDetails', 'type': 'DataGenerationVertical'}, - 'finetuning_details': {'key': 'finetuningDetails', 'type': 'FinetuningDetails'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_generation_details: Required. [Required]. - :paramtype data_generation_details: - ~azure.mgmt.machinelearningservices.models.DataGenerationVertical - :keyword finetuning_details: Required. [Required]. - :paramtype finetuning_details: ~azure.mgmt.machinelearningservices.models.FinetuningDetails - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Instance types and other resources for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - super(DistillationJob, self).__init__(**kwargs) - self.job_type = 'Distillation' # type: str - self.data_generation_details = kwargs['data_generation_details'] - self.finetuning_details = kwargs['finetuning_details'] - self.outputs = kwargs['outputs'] - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = kwargs.get('password', None) - self.user_name = kwargs.get('user_name', None) - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = kwargs.get('cosmos_db_resource_id', None) - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - self.search_account_resource_id = kwargs.get('search_account_resource_id', None) - self.status = kwargs['status'] - self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - self.version = kwargs.get('version', None) - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = kwargs.get('keys', None) - - -class EndpointModelDeprecationProperties(msrest.serialization.Model): - """EndpointModelDeprecationProperties. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: ~datetime.datetime - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: ~datetime.datetime - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'iso-8601'}, - 'inference': {'key': 'inference', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: ~datetime.datetime - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: ~datetime.datetime - """ - super(EndpointModelDeprecationProperties, self).__init__(**kwargs) - self.fine_tune = kwargs.get('fine_tune', None) - self.inference = kwargs.get('inference', None) - - -class EndpointModelProperties(msrest.serialization.Model): - """Endpoint Model properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar deprecation: - :vartype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar format: Deployment model format. - :vartype format: str - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar name: Deployment model name. - :vartype name: str - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'EndpointModelDeprecationProperties'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'format': {'key': 'format', 'type': 'str'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'skus': {'key': 'skus', 'type': '[EndpointModelSkuProperties]'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword deprecation: - :paramtype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword format: Deployment model format. - :paramtype format: str - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword name: Deployment model name. - :paramtype name: str - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - """ - super(EndpointModelProperties, self).__init__(**kwargs) - self.capabilities = kwargs.get('capabilities', None) - self.deprecation = kwargs.get('deprecation', None) - self.finetune_capabilities = kwargs.get('finetune_capabilities', None) - self.format = kwargs.get('format', None) - self.is_default_version = kwargs.get('is_default_version', None) - self.lifecycle_status = kwargs.get('lifecycle_status', None) - self.max_capacity = kwargs.get('max_capacity', None) - self.name = kwargs.get('name', None) - self.skus = kwargs.get('skus', None) - self.system_data = None - self.version = kwargs.get('version', None) - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointModelProperties]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointModelSkuCapacityProperties(msrest.serialization.Model): - """EndpointModelSkuCapacityProperties. - - :ivar default: The default capacity. - :vartype default: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: The default capacity. - :paramtype default: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - """ - super(EndpointModelSkuCapacityProperties, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.maximum = kwargs.get('maximum', None) - - -class EndpointModelSkuProperties(msrest.serialization.Model): - """EndpointModelSkuProperties. - - :ivar capacity: - :vartype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :ivar connection_ids: The list of ARM id for the connection support this SKU. - :vartype connection_ids: list[str] - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar name: The name of the model SKU. - :vartype name: str - :ivar rate_limits: - :vartype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'EndpointModelSkuCapacityProperties'}, - 'connection_ids': {'key': 'connectionIds', 'type': '[str]'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[EndpointModelSkuRateLimitProperties]'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :keyword connection_ids: The list of ARM id for the connection support this SKU. - :paramtype connection_ids: list[str] - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword rate_limits: - :paramtype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - """ - super(EndpointModelSkuProperties, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.connection_ids = kwargs.get('connection_ids', None) - self.deprecation_date = kwargs.get('deprecation_date', None) - self.name = kwargs.get('name', None) - self.rate_limits = kwargs.get('rate_limits', None) - self.usage_name = kwargs.get('usage_name', None) - - -class EndpointModelSkuRateLimitProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitProperties. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: The call rate limit for the model. - :vartype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[EndpointModelSkuRateLimitRuleProperties]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: The call rate limit for the model. - :paramtype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - super(EndpointModelSkuRateLimitProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.renewal_period = kwargs.get('renewal_period', None) - self.rules = kwargs.get('rules', None) - - -class EndpointModelSkuRateLimitRulePatternProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRulePatternProperties. - - :ivar method: - :vartype method: str - :ivar path: - :vartype path: str - """ - - _attribute_map = { - 'method': {'key': 'method', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword method: - :paramtype method: str - :keyword path: - :paramtype path: str - """ - super(EndpointModelSkuRateLimitRulePatternProperties, self).__init__(**kwargs) - self.method = kwargs.get('method', None) - self.path = kwargs.get('path', None) - - -class EndpointModelSkuRateLimitRuleProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRuleProperties. - - :ivar count: - :vartype count: float - :ivar dynamic_throttling_enabled: If the dynamic throttling is enabled. - :vartype dynamic_throttling_enabled: bool - :ivar key: - :vartype key: str - :ivar match_patterns: - :vartype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :ivar min_count: - :vartype min_count: float - :ivar renewal_period: - :vartype renewal_period: float - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'key': {'key': 'key', 'type': 'str'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[EndpointModelSkuRateLimitRulePatternProperties]'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword count: - :paramtype count: float - :keyword dynamic_throttling_enabled: If the dynamic throttling is enabled. - :paramtype dynamic_throttling_enabled: bool - :keyword key: - :paramtype key: str - :keyword match_patterns: - :paramtype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :keyword min_count: - :paramtype min_count: float - :keyword renewal_period: - :paramtype renewal_period: float - """ - super(EndpointModelSkuRateLimitRuleProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.dynamic_throttling_enabled = kwargs.get('dynamic_throttling_enabled', None) - self.key = kwargs.get('key', None) - self.match_patterns = kwargs.get('match_patterns', None) - self.min_count = kwargs.get('min_count', None) - self.renewal_period = kwargs.get('renewal_period', None) - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar image_details: Environment image details. - :vartype image_details: ~azure.mgmt.machinelearningservices.models.ImageDetails - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'image_details': {'key': 'imageDetails', 'type': 'ImageDetails'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword image_details: Environment image details. - :paramtype image_details: ~azure.mgmt.machinelearningservices.models.ImageDetails - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) - self.environment_type = None - self.image = kwargs.get('image', None) - self.image_details = kwargs.get('image_details', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.feature_importance_settings = kwargs['feature_importance_settings'] - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.target_column = kwargs.get('target_column', None) - - -class FeatureProperties(ResourceBase): - """DTO object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(**kwargs) - self.data_type = kwargs.get('data_type', None) - self.feature_name = kwargs.get('feature_name', None) - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetContainerProperties(AssetContainer): - """DTO object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturesetSpecification(msrest.serialization.Model): - """DTO object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = kwargs.get('data_availability_status', None) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.properties = kwargs.get('properties', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', None) - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = kwargs.get('job_ids', None) - - -class FeaturesetVersionProperties(AssetBase): - """DTO object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.materialization_settings = kwargs.get('materialization_settings', None) - self.provisioning_state = None - self.specification = kwargs.get('specification', None) - self.stage = kwargs.get('stage', None) - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """DTO object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class FeaturestoreEntityVersionProperties(AssetBase): - """DTO object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get('index_columns', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = kwargs['features'] - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = kwargs.get('feature_window_end', None) - self.feature_window_start = kwargs.get('feature_window_start', None) - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) - - -class FinetuningDetails(msrest.serialization.Model): - """FinetuningDetails. - - All required parameters must be populated in order to send to Azure. - - :ivar hyper_parameters: Finetuning Hyperparameters. - :vartype hyper_parameters: dict[str, str] - :ivar student_model: Required. [Required] Student model for fine tuning. - :vartype student_model: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'student_model': {'required': True}, - } - - _attribute_map = { - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - 'student_model': {'key': 'studentModel', 'type': 'JobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hyper_parameters: Finetuning Hyperparameters. - :paramtype hyper_parameters: dict[str, str] - :keyword student_model: Required. [Required] Student model for fine tuning. - :paramtype student_model: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FinetuningDetails, self).__init__(**kwargs) - self.hyper_parameters = kwargs.get('hyper_parameters', None) - self.student_model = kwargs['student_model'] - - -class FineTuningJob(JobBaseProperties): - """FineTuning Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar fine_tuning_details: Required. [Required]. - :vartype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Instance types and other resources for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'fine_tuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'fine_tuning_details': {'key': 'fineTuningDetails', 'type': 'FineTuningVertical'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword fine_tuning_details: Required. [Required]. - :paramtype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Instance types and other resources for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - super(FineTuningJob, self).__init__(**kwargs) - self.job_type = 'FineTuning' # type: str - self.fine_tuning_details = kwargs['fine_tuning_details'] - self.outputs = kwargs['outputs'] - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) - self.data_context = kwargs.get('data_context', None) - self.input_data_type = None # type: Optional[str] - self.job_input_type = kwargs['job_input_type'] - self.uri = kwargs['uri'] - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(**kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.parent_rule_names = None - self.status = kwargs.get('status', None) - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.blob_uri = kwargs.get('blob_uri', None) - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: - list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '[StringKeyValuePair]'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: - list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(GroupEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.readiness_probe = kwargs.get('readiness_probe', None) - self.startup_probe = kwargs.get('startup_probe', None) - - -class GroupModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(GroupModelConfiguration, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = kwargs.get('actual_capacity_info', None) - self.endpoint_count = kwargs.get('endpoint_count', 0) - self.requested_capacity = kwargs.get('requested_capacity', 0) - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) - self.version = kwargs.get('version', None) - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageDetails(msrest.serialization.Model): - """ImageDetails. - - :ivar exists: Indicates if image exists. - :vartype exists: bool - :ivar image: Container image details. - :vartype image: ~azure.mgmt.machinelearningservices.models.ImageInfo - :ivar vulnerability_findings: Vulnerability findings details. - :vartype vulnerability_findings: - ~azure.mgmt.machinelearningservices.models.VulnerabilityFindings - """ - - _attribute_map = { - 'exists': {'key': 'exists', 'type': 'bool'}, - 'image': {'key': 'image', 'type': 'ImageInfo'}, - 'vulnerability_findings': {'key': 'vulnerabilityFindings', 'type': 'VulnerabilityFindings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword exists: Indicates if image exists. - :paramtype exists: bool - :keyword image: Container image details. - :paramtype image: ~azure.mgmt.machinelearningservices.models.ImageInfo - :keyword vulnerability_findings: Vulnerability findings details. - :paramtype vulnerability_findings: - ~azure.mgmt.machinelearningservices.models.VulnerabilityFindings - """ - super(ImageDetails, self).__init__(**kwargs) - self.exists = kwargs.get('exists', None) - self.image = kwargs.get('image', None) - self.vulnerability_findings = kwargs.get('vulnerability_findings', None) - - -class ImageInfo(msrest.serialization.Model): - """ImageInfo. - - :ivar digest: Image digest. - :vartype digest: str - :ivar hostname: Container registry host name. - :vartype hostname: str - :ivar repository: Repository name. - :vartype repository: str - :ivar tag: Image tag. - :vartype tag: str - """ - - _attribute_map = { - 'digest': {'key': 'digest', 'type': 'str'}, - 'hostname': {'key': 'hostname', 'type': 'str'}, - 'repository': {'key': 'repository', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword digest: Image digest. - :paramtype digest: str - :keyword hostname: Container registry host name. - :paramtype hostname: str - :keyword repository: Repository name. - :paramtype repository: str - :keyword tag: Image tag. - :paramtype tag: str - """ - super(ImageInfo, self).__init__(**kwargs) - self.digest = kwargs.get('digest', None) - self.hostname = kwargs.get('hostname', None) - self.repository = kwargs.get('repository', None) - self.tag = kwargs.get('tag', None) - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -class IndexColumn(msrest.serialization.Model): - """DTO object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.data_type = kwargs.get('data_type', None) - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_name: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :vartype group_name: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: RequestConfiguration for endpoint. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_name: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_name: str - :keyword request_configuration: RequestConfiguration for endpoint. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferenceEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.endpoint_uri = None - self.group_name = kwargs['group_name'] - self.provisioning_state = None - self.request_configuration = kwargs.get('request_configuration', None) - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar environment_configuration: Gets or sets environment configuration for the inference - group. Used if PoolType=ScaleUnit. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.GroupEnvironmentConfiguration - :ivar model_configuration: Gets or sets model configuration for the inference group. Used if - PoolType=ScaleUnit. - :vartype model_configuration: - ~azure.mgmt.machinelearningservices.models.GroupModelConfiguration - :ivar node_sku_type: Gets or sets compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar scale_unit_size: Gets or sets Scale Unit size. - :vartype scale_unit_size: int - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'GroupEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'GroupModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'scale_unit_size': {'key': 'scaleUnitSize', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword environment_configuration: Gets or sets environment configuration for the inference - group. Used if PoolType=ScaleUnit. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.GroupEnvironmentConfiguration - :keyword model_configuration: Gets or sets model configuration for the inference group. Used if - PoolType=ScaleUnit. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.GroupModelConfiguration - :keyword node_sku_type: Gets or sets compute instance type. - :paramtype node_sku_type: str - :keyword scale_unit_size: Gets or sets Scale Unit size. - :paramtype scale_unit_size: int - """ - super(InferenceGroupProperties, self).__init__(**kwargs) - self.environment_configuration = kwargs.get('environment_configuration', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.node_sku_type = kwargs.get('node_sku_type', None) - self.provisioning_state = None - self.scale_unit_size = kwargs.get('scale_unit_size', None) - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar scale_unit_configuration: Gets or sets ScaleUnitConfiguration for the inference pool. - Used if PoolType=ScaleUnit. - :vartype scale_unit_configuration: - ~azure.mgmt.machinelearningservices.models.ScaleUnitConfiguration - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'scale_unit_configuration': {'key': 'scaleUnitConfiguration', 'type': 'ScaleUnitConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword scale_unit_configuration: Gets or sets ScaleUnitConfiguration for the inference pool. - Used if PoolType=ScaleUnit. - :paramtype scale_unit_configuration: - ~azure.mgmt.machinelearningservices.models.ScaleUnitConfiguration - """ - super(InferencePoolProperties, self).__init__(**kwargs) - self.provisioning_state = None - self.scale_unit_configuration = kwargs.get('scale_unit_configuration', None) - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) - - -class IPRule(msrest.serialization.Model): - """Contains an IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' or 'Deny'. - - :ivar value: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) - or '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' or - 'Deny'. - :vartype value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP - address) or '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' - or 'Deny'. - :paramtype value: str - """ - super(IPRule, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar docker_args_list: Extra arguments to pass to the Docker run command, as a collection. - This would override any parameters that have already been set by the system, or in this - section. This parameter is only supported for Azure ML compute types. - :vartype docker_args_list: list[str] - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'docker_args_list': {'key': 'dockerArgsList', 'type': '[str]'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword docker_args_list: Extra arguments to pass to the Docker run command, as a collection. - This would override any parameters that have already been set by the system, or in this - section. This parameter is only supported for Azure ML compute types. - :paramtype docker_args_list: list[str] - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.docker_args_list = kwargs.get('docker_args_list', None) - self.shm_size = kwargs.get('shm_size', "2g") - - -class JobResources(msrest.serialization.Model): - """JobResources. - - :ivar instance_types: List of instance types to choose from. - :vartype instance_types: list[str] - """ - - _attribute_map = { - 'instance_types': {'key': 'instanceTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_types: List of instance types to choose from. - :paramtype instance_types: list[str] - """ - super(JobResources, self).__init__(**kwargs) - self.instance_types = kwargs.get('instance_types', None) - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = kwargs.get('argv', None) - self.display_name = kwargs.get('display_name', None) - self.language = kwargs.get('language', None) - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = kwargs.get('identity_client_id', None) - self.key_identifier = kwargs['key_identifier'] - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. Default: Standard_F4s_v2. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.data_collector = kwargs.get('data_collector', None) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', "Standard_F4s_v2") - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. Default: Standard_F4s_v2. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) - - -class LabelGeneration(DataGenerationVertical): - """LabelGeneration. - - All required parameters must be populated in order to send to Azure. - - :ivar data_generation_task_type: Required. [Required] DataGeneration Task type. Possible values - include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :vartype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :ivar data_generation_type: Required. [Required] Enum to determine the type of Data - Generation.Constant filled by server. Possible values include: "LabelGeneration", - "DataGeneration". - :vartype data_generation_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationType - :ivar prompt_settings: Prompt Settings. - :vartype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :ivar teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :vartype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :ivar teacher_model_settings: - :vartype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - :ivar training_data: Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'data_generation_task_type': {'required': True}, - 'data_generation_type': {'required': True}, - 'teacher_model_endpoint': {'required': True}, - } - - _attribute_map = { - 'data_generation_task_type': {'key': 'dataGenerationTaskType', 'type': 'str'}, - 'data_generation_type': {'key': 'dataGenerationType', 'type': 'str'}, - 'prompt_settings': {'key': 'promptSettings', 'type': 'PromptSettings'}, - 'teacher_model_endpoint': {'key': 'teacherModelEndpoint', 'type': 'TeacherModelEndpoint'}, - 'teacher_model_settings': {'key': 'teacherModelSettings', 'type': 'TeacherModelSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_generation_task_type: Required. [Required] DataGeneration Task type. Possible - values include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :paramtype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :keyword prompt_settings: Prompt Settings. - :paramtype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :keyword teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :paramtype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :keyword teacher_model_settings: - :paramtype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - :keyword training_data: Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(LabelGeneration, self).__init__(**kwargs) - self.data_generation_type = 'LabelGeneration' # type: str - self.training_data = kwargs.get('training_data', None) - self.validation_data = kwargs.get('validation_data', None) - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = kwargs['artifact_name'] - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(**kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = kwargs.get('container_registry_credentials', None) - self.notebook_access_keys = kwargs.get('notebook_access_keys', None) - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: The identity which will be leveraged by the monitoring jobs. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity which will be leveraged by the monitoring jobs. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = kwargs.get('identity', None) - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = kwargs.get('managed_identity_type', None) - self.user_managed_identity_client_id = kwargs.get('user_managed_identity_client_id', None) - self.user_managed_identity_principal_id = kwargs.get('user_managed_identity_principal_id', None) - self.user_managed_identity_resource_id = kwargs.get('user_managed_identity_resource_id', None) - self.user_managed_identity_tenant_id = kwargs.get('user_managed_identity_tenant_id', None) - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = kwargs.get('spark_ready', None) - self.status = kwargs.get('status', None) - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. - :vartype firewall_public_ip_address: str - :ivar firewall_sku: Firewall Sku used for FQDN Rules. Possible values include: "Standard", - "Basic". - :vartype firewall_sku: str or ~azure.mgmt.machinelearningservices.models.FirewallSku - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'firewall_public_ip_address': {'readonly': True}, - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'firewall_public_ip_address': {'key': 'firewallPublicIpAddress', 'type': 'str'}, - 'firewall_sku': {'key': 'firewallSku', 'type': 'str'}, - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword firewall_sku: Firewall Sku used for FQDN Rules. Possible values include: "Standard", - "Basic". - :paramtype firewall_sku: str or ~azure.mgmt.machinelearningservices.models.FirewallSku - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.firewall_public_ip_address = None - self.firewall_sku = kwargs.get('firewall_sku', None) - self.isolation_mode = kwargs.get('isolation_mode', None) - self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. Default: Standard_F4s_v2. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - :ivar endpoint_compute_type: Enum to determine endpoint compute type. Possible values include: - "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar model: - :vartype model: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword endpoint_compute_type: Enum to determine endpoint compute type. Possible values - include: "Managed", "Kubernetes", "AzureMLCompute". - :paramtype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :keyword model: - :paramtype model: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.type = 'managedOnlineEndpoint' # type: str - self.endpoint_compute_type = kwargs.get('endpoint_compute_type', None) - self.model = kwargs.get('model', None) - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar compute: - :vartype compute: str - :ivar description: - :vartype description: str - :ivar mirror_traffic: Dictionary of :code:``. - :vartype mirror_traffic: dict[str, int] - :ivar scoring_uri: - :vartype scoring_uri: str - :ivar traffic: Dictionary of :code:``. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword compute: - :paramtype compute: str - :keyword description: - :paramtype description: str - :keyword mirror_traffic: Dictionary of :code:``. - :paramtype mirror_traffic: dict[str, int] - :keyword scoring_uri: - :paramtype scoring_uri: str - :keyword traffic: Dictionary of :code:``. - :paramtype traffic: dict[str, int] - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - self.auth_mode = kwargs.get('auth_mode', None) - self.compute = kwargs.get('compute', None) - self.description = kwargs.get('description', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.scoring_uri = kwargs.get('scoring_uri', None) - self.traffic = kwargs.get('traffic', None) - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = None - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = kwargs.get('assigned_identities', None) - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The identifying name of the Offer of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The identifying name of the Plan of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The identifying name of the Publisher of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = kwargs['model_id'] - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MaterializationComputeResource(msrest.serialization.Model): - """DTO object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = kwargs.get('notification', None) - self.resource = kwargs.get('resource', None) - self.schedule = kwargs.get('schedule', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.store_type = kwargs.get('store_type', None) - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(**kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - :ivar model_id: The unique model identifier that this ServerlessEndpoint should provision. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: The unique model identifier that this ServerlessEndpoint should provision. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', None) - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The entities targeted by the monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The entities targeted by the monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = kwargs.get('alert_notification_settings', None) - self.compute_configuration = kwargs['compute_configuration'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: The email recipient list which has a limitation of 499 characters in total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword emails: The email recipient list which has a limitation of 499 characters in total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = kwargs.get('emails', None) - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: Reference to the deployment asset targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: Reference to the model asset targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword deployment_id: Reference to the deployment asset targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: Reference to the model asset targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = kwargs.get('deployment_id', None) - self.model_id = kwargs.get('model_id', None) - self.task_type = kwargs['task_type'] - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = kwargs.get('email_notification_settings', None) - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = kwargs['compute_identity'] - self.instance_type = kwargs['instance_type'] - self.runtime_version = kwargs['runtime_version'] - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class NetworkAcls(msrest.serialization.Model): - """NetworkAcls. - - :ivar default_action: The default action when no rule from ipRules and from virtualNetworkRules - match. This is only used after the bypass property has been evaluated. Possible values include: - "Deny", "Allow". - :vartype default_action: str or ~azure.mgmt.machinelearningservices.models.DefaultActionType - :ivar ip_rules: Rules governing the accessibility of a resource from a specific ip address or - ip range. - :vartype ip_rules: list[~azure.mgmt.machinelearningservices.models.IPRule] - """ - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default_action: The default action when no rule from ipRules and from - virtualNetworkRules match. This is only used after the bypass property has been evaluated. - Possible values include: "Deny", "Allow". - :paramtype default_action: str or ~azure.mgmt.machinelearningservices.models.DefaultActionType - :keyword ip_rules: Rules governing the accessibility of a resource from a specific ip address - or ip range. - :paramtype ip_rules: list[~azure.mgmt.machinelearningservices.models.IPRule] - """ - super(NetworkAcls, self).__init__(**kwargs) - self.default_action = kwargs.get('default_action', None) - self.ip_rules = kwargs.get('ip_rules', None) - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(**kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.is_private_link_enabled = kwargs.get('is_private_link_enabled', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) - self.resource_id = kwargs.get('resource_id', None) - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get('email_on', None) - self.emails = kwargs.get('emails', None) - self.webhooks = kwargs.get('webhooks', None) - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = kwargs.get('credentials', None) - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(**kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = kwargs['artifact'] - self.endpoint = kwargs.get('endpoint', None) - self.one_lake_workspace_name = kwargs['one_lake_workspace_name'] - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] The authentication method for invoking the endpoint (data - plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine - Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] The authentication method for invoking the endpoint - (data plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure - Machine Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(OpenAIEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = kwargs.get('display', None) - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - :ivar os_patching_errors: Collection of errors encountered when doing os patching. - :vartype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - 'os_patching_errors': {'key': 'osPatchingErrors', 'type': '[ErrorResponse]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - :keyword os_patching_errors: Collection of errors encountered when doing os patching. - :paramtype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = kwargs.get('patch_status', None) - self.latest_patch_time = kwargs.get('latest_patch_time', None) - self.reboot_pending = kwargs.get('reboot_pending', None) - self.scheduled_reboot_time = kwargs.get('scheduled_reboot_time', None) - self.os_patching_errors = kwargs.get('os_patching_errors', None) - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) - - -class PackageDetails(msrest.serialization.Model): - """PackageDetails. - - :ivar install_path: Install path. - :vartype install_path: str - :ivar installed_version: Installed version. - :vartype installed_version: str - :ivar name: Package or dependency name. - :vartype name: str - :ivar patched_version: Patched version. - :vartype patched_version: str - """ - - _attribute_map = { - 'install_path': {'key': 'installPath', 'type': 'str'}, - 'installed_version': {'key': 'installedVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'patched_version': {'key': 'patchedVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword install_path: Install path. - :paramtype install_path: str - :keyword installed_version: Installed version. - :paramtype installed_version: str - :keyword name: Package or dependency name. - :paramtype name: str - :keyword patched_version: Patched version. - :paramtype patched_version: str - """ - super(PackageDetails, self).__init__(**kwargs) - self.install_path = kwargs.get('install_path', None) - self.installed_version = kwargs.get('installed_version', None) - self.name = kwargs.get('name', None) - self.patched_version = kwargs.get('patched_version', None) - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = kwargs.get('feature_data_type_override', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) - self.subresource_target = kwargs.get('subresource_target', None) - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :ivar fqdns: - :vartype fqdns: list[str] - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - 'fqdns': {'key': 'fqdns', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :keyword fqdns: - :paramtype fqdns: list[str] - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) - self.fqdns = kwargs.get('fqdns', None) - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") - - -class PromptSettings(msrest.serialization.Model): - """PromptSettings. - - :ivar enable_chain_of_density: - :vartype enable_chain_of_density: bool - :ivar enable_chain_of_thought: - :vartype enable_chain_of_thought: bool - :ivar max_len_summary: - :vartype max_len_summary: int - """ - - _attribute_map = { - 'enable_chain_of_density': {'key': 'enableChainOfDensity', 'type': 'bool'}, - 'enable_chain_of_thought': {'key': 'enableChainOfThought', 'type': 'bool'}, - 'max_len_summary': {'key': 'maxLenSummary', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_chain_of_density: - :paramtype enable_chain_of_density: bool - :keyword enable_chain_of_thought: - :paramtype enable_chain_of_thought: bool - :keyword max_len_summary: - :paramtype max_len_summary: int - """ - super(PromptSettings, self).__init__(**kwargs) - self.enable_chain_of_density = kwargs.get('enable_chain_of_density', None) - self.enable_chain_of_thought = kwargs.get('enable_chain_of_thought', None) - self.max_len_summary = kwargs.get('max_len_summary', None) - - -class PTUDeploymentUsage(msrest.serialization.Model): - """PTUDeploymentUsage. - - :ivar collection_quota_usage: Usage number from the collection level quota. - :vartype collection_quota_usage: long - :ivar deployment_name: Deployment name. - :vartype deployment_name: str - :ivar resource_group: Resource group name. - :vartype resource_group: str - :ivar usage: Usage number from subscription level quota. - :vartype usage: long - :ivar workspace_name: Workspace name. - :vartype workspace_name: str - """ - - _attribute_map = { - 'collection_quota_usage': {'key': 'collectionQuotaUsage', 'type': 'long'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'usage': {'key': 'usage', 'type': 'long'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collection_quota_usage: Usage number from the collection level quota. - :paramtype collection_quota_usage: long - :keyword deployment_name: Deployment name. - :paramtype deployment_name: str - :keyword resource_group: Resource group name. - :paramtype resource_group: str - :keyword usage: Usage number from subscription level quota. - :paramtype usage: long - :keyword workspace_name: Workspace name. - :paramtype workspace_name: str - """ - super(PTUDeploymentUsage, self).__init__(**kwargs) - self.collection_quota_usage = kwargs.get('collection_quota_usage', None) - self.deployment_name = kwargs.get('deployment_name', None) - self.resource_group = kwargs.get('resource_group', None) - self.usage = kwargs.get('usage', None) - self.workspace_name = kwargs.get('workspace_name', None) - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) - - -class RaiBlocklistConfig(msrest.serialization.Model): - """Azure OpenAI blocklist config. - - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - """ - - _attribute_map = { - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'blocklist_name': {'key': 'blocklistName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword blocklist_name: Name of ContentFilter. - :paramtype blocklist_name: str - """ - super(RaiBlocklistConfig, self).__init__(**kwargs) - self.blocking = kwargs.get('blocking', None) - self.blocklist_name = kwargs.get('blocklist_name', None) - - -class RaiBlocklistItemBulkRequest(msrest.serialization.Model): - """The Cognitive Services RaiBlocklist Item request body. - - :ivar name: - :vartype name: str - :ivar properties: Properties of Cognitive Services RaiBlocklist Item. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: - :paramtype name: str - :keyword properties: Properties of Cognitive Services RaiBlocklist Item. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemBulkRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.properties = kwargs.get('properties', None) - - -class RaiBlocklistItemProperties(msrest.serialization.Model): - """RAI Custom Blocklist Item properties. - - :ivar is_regex: If the pattern is a regex pattern. - :vartype is_regex: bool - :ivar pattern: Pattern to match against. - :vartype pattern: str - """ - - _attribute_map = { - 'is_regex': {'key': 'isRegex', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword is_regex: If the pattern is a regex pattern. - :paramtype is_regex: bool - :keyword pattern: Pattern to match against. - :paramtype pattern: str - """ - super(RaiBlocklistItemProperties, self).__init__(**kwargs) - self.is_regex = kwargs.get('is_regex', None) - self.pattern = kwargs.get('pattern', None) - - -class RaiBlocklistItemPropertiesBasicResource(Resource): - """RaiBlocklistItemPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist Item properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist Item properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistItemPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - super(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RaiBlocklistProperties(msrest.serialization.Model): - """RAI Custom Blocklist properties. - - :ivar description: Description of the block list. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Description of the block list. - :paramtype description: str - """ - super(RaiBlocklistProperties, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - - -class RaiBlocklistPropertiesBasicResource(Resource): - """RaiBlocklistPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - super(RaiBlocklistPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiBlocklistPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - super(RaiBlocklistPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RaiPolicyContentFilter(msrest.serialization.Model): - """Azure OpenAI Content Filter. - - :ivar allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :vartype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar enabled: If the ContentFilter is enabled. - :vartype enabled: bool - :ivar name: Name of ContentFilter. - :vartype name: str - :ivar source: Content source to apply the Content Filters. Possible values include: "Prompt", - "Completion". - :vartype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - - _attribute_map = { - 'allowed_content_level': {'key': 'allowedContentLevel', 'type': 'str'}, - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :paramtype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword enabled: If the ContentFilter is enabled. - :paramtype enabled: bool - :keyword name: Name of ContentFilter. - :paramtype name: str - :keyword source: Content source to apply the Content Filters. Possible values include: - "Prompt", "Completion". - :paramtype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - super(RaiPolicyContentFilter, self).__init__(**kwargs) - self.allowed_content_level = kwargs.get('allowed_content_level', None) - self.blocking = kwargs.get('blocking', None) - self.enabled = kwargs.get('enabled', None) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - - -class RaiPolicyProperties(msrest.serialization.Model): - """Azure OpenAI Content Filters properties. - - :ivar base_policy_name: Name of the base Content Filters. - :vartype base_policy_name: str - :ivar completion_blocklists: - :vartype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar content_filters: - :vartype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :ivar mode: Content Filters mode. Possible values include: "Default", "Deferred", "Blocking". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :ivar prompt_blocklists: - :vartype prompt_blocklists: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - - _attribute_map = { - 'base_policy_name': {'key': 'basePolicyName', 'type': 'str'}, - 'completion_blocklists': {'key': 'completionBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'content_filters': {'key': 'contentFilters', 'type': '[RaiPolicyContentFilter]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'prompt_blocklists': {'key': 'promptBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_policy_name: Name of the base Content Filters. - :paramtype base_policy_name: str - :keyword completion_blocklists: - :paramtype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword content_filters: - :paramtype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :keyword mode: Content Filters mode. Possible values include: "Default", "Deferred", - "Blocking". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :keyword prompt_blocklists: - :paramtype prompt_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - super(RaiPolicyProperties, self).__init__(**kwargs) - self.base_policy_name = kwargs.get('base_policy_name', None) - self.completion_blocklists = kwargs.get('completion_blocklists', None) - self.content_filters = kwargs.get('content_filters', None) - self.mode = kwargs.get('mode', None) - self.prompt_blocklists = kwargs.get('prompt_blocklists', None) - self.type = kwargs.get('type', None) - - -class RaiPolicyPropertiesBasicResource(Resource): - """Azure OpenAI Content Filters resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Azure OpenAI Content Filters properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiPolicyProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. Azure OpenAI Content Filters properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - super(RaiPolicyPropertiesBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RaiPolicyPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """Azure OpenAI Content Filters resource list. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiPolicyPropertiesBasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - super(RaiPolicyPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.managed_resource_group_settings = kwargs.get('managed_resource_group_settings', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.registry_private_endpoint_connections = kwargs.get('registry_private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = kwargs.get('passwords', None) - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(**kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.registry_private_link_service_connection_state = kwargs.get('registry_private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.request_timeout = kwargs.get('request_timeout', "PT5S") - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = kwargs.get('capture_headers', None) - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = kwargs.get('target_vm_size', None) - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the rolling data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the rolling data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(**kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_offset = kwargs['window_offset'] - self.window_size = kwargs['window_size'] - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) - - -class ScaleUnitConfiguration(msrest.serialization.Model): - """Configuration for ScaleUnit pool. - - :ivar disable_public_egress: Gets or sets a value indicating whether PublicEgress is disabled. - :vartype disable_public_egress: bool - :ivar registries: Gets or sets a list of Registry sources that will be used to confirm - identity, storage, ACR. - :vartype registries: list[str] - """ - - _attribute_map = { - 'disable_public_egress': {'key': 'disablePublicEgress', 'type': 'bool'}, - 'registries': {'key': 'registries', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword disable_public_egress: Gets or sets a value indicating whether PublicEgress is - disabled. - :paramtype disable_public_egress: bool - :keyword registries: Gets or sets a list of Registry sources that will be used to confirm - identity, storage, ACR. - :paramtype registries: list[str] - """ - super(ScaleUnitConfiguration, self).__init__(**kwargs) - self.disable_public_egress = kwargs.get('disable_public_egress', False) - self.registries = kwargs.get('registries', None) - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) - self.provisioning_state = None - self.trigger = kwargs['trigger'] - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) - - -class SecretExpiry(msrest.serialization.Model): - """Secret expiration configuration. - - :ivar expirable_secret: Indicates if the secret is expirable. - :vartype expirable_secret: bool - :ivar expire_after_hours: Number of hours after which the secret will expire. - :vartype expire_after_hours: int - """ - - _attribute_map = { - 'expirable_secret': {'key': 'expirableSecret', 'type': 'bool'}, - 'expire_after_hours': {'key': 'expireAfterHours', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword expirable_secret: Indicates if the secret is expirable. - :paramtype expirable_secret: bool - :keyword expire_after_hours: Number of hours after which the secret will expire. - :paramtype expire_after_hours: int - """ - super(SecretExpiry, self).__init__(**kwargs) - self.expirable_secret = kwargs.get('expirable_secret', False) - self.expire_after_hours = kwargs.get('expire_after_hours', 1) - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = kwargs.get('serverless_compute_custom_subnet', None) - self.serverless_compute_no_public_ip = kwargs.get('serverless_compute_no_public_ip', None) - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = kwargs['capacity_reservation_group_id'] - self.endpoint_reserved_capacity = kwargs.get('endpoint_reserved_capacity', None) - - -class ServerlessEndpointContentSafety(msrest.serialization.Model): - """ServerlessEndpointContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_status: Required. Specifies the status of content safety. Possible values - include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword content_safety_status: Required. Specifies the status of content safety. Possible - values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ServerlessEndpointContentSafety, self).__init__(**kwargs) - self.content_safety_status = kwargs['content_safety_status'] - - -class ServerlessEndpointInferenceEndpoint(msrest.serialization.Model): - """ServerlessEndpointInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Dictionary of :code:``. - :vartype headers: dict[str, str] - :ivar uri: Required. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Required. - :paramtype uri: str - """ - super(ServerlessEndpointInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = kwargs['uri'] - - -class ServerlessEndpointModelSettings(msrest.serialization.Model): - """ServerlessEndpointModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_id: Required. - :paramtype model_id: str - """ - super(ServerlessEndpointModelSettings, self).__init__(**kwargs) - self.model_id = kwargs['model_id'] - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key", "AAD", "KeyAndAAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :vartype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :ivar endpoint_state: The current state of the ServerlessEndpoint. Possible values include: - "Unknown", "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", - "CreationFailed", "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription Azure ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_state': {'readonly': True}, - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key", "AAD", "KeyAndAAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :paramtype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.content_safety = kwargs.get('content_safety', None) - self.endpoint_state = None - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = kwargs.get('model_settings', None) - self.provisioning_state = None - - -class ServerlessEndpointResourceProperties(EndpointResourceProperties): - """ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Possible values include: "Key", "AAD", "KeyAndAAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar content_safety: - :vartype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :ivar marketplace_subscription_id: - :vartype marketplace_subscription_id: str - :ivar metadata: Anything. - :vartype metadata: any - :ivar model_settings: - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :ivar offer: - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ServerlessEndpointContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessEndpointInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ServerlessEndpointModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Possible values include: "Key", "AAD", "KeyAndAAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword content_safety: - :paramtype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :keyword endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :paramtype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :keyword inference_endpoint: - :paramtype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :keyword marketplace_subscription_id: - :paramtype marketplace_subscription_id: str - :keyword metadata: Anything. - :paramtype metadata: any - :keyword model_settings: - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :keyword offer: - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'serverlessEndpoint' # type: str - self.auth_mode = kwargs.get('auth_mode', None) - self.capacity_reservation = kwargs.get('capacity_reservation', None) - self.content_safety = kwargs.get('content_safety', None) - self.endpoint_state = kwargs.get('endpoint_state', None) - self.inference_endpoint = kwargs.get('inference_endpoint', None) - self.marketplace_subscription_id = kwargs.get('marketplace_subscription_id', None) - self.metadata = kwargs.get('metadata', None) - self.model_settings = kwargs.get('model_settings', None) - self.offer = kwargs.get('offer', None) - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = kwargs['uri'] - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. - :vartype offer_name: str - :ivar publisher: Required. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword offer_name: Required. - :paramtype offer_name: str - :keyword publisher: Required. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = kwargs['offer_name'] - self.publisher = kwargs['publisher'] - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :paramtype address_prefixes: list[str] - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.address_prefixes = kwargs.get('address_prefixes', None) - self.port_ranges = kwargs.get('port_ranges', None) - self.protocol = kwargs.get('protocol', None) - self.service_tag = kwargs.get('service_tag', None) - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.group_id = kwargs.get('group_id', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.resource_type = None - self.sku = kwargs.get('sku', None) - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] arm-id of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] arm-id of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = kwargs['model'] - self.rai_policy_name = kwargs.get('rai_policy_name', None) - self.sku = kwargs.get('sku', None) - self.version_upgrade_option = kwargs.get('version_upgrade_option', None) - self.type = 'Azure.Speech' # type: str - self.failure_reason = kwargs.get('failure_reason', None) - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(SpeechEndpointResourceProperties, self).__init__(**kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(**kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.window_end = kwargs['window_end'] - self.window_start = kwargs['window_start'] - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) - - -class StringArmPaginatedResult(msrest.serialization.Model): - """A paginated list of String entities. - - :ivar next_link: The link to the next page of String objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type String. - :vartype value: list[str] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of String objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type String. - :paramtype value: list[str] - """ - super(StringArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class StringKeyValuePair(msrest.serialization.Model): - """StringKeyValuePair. - - :ivar key: - :vartype key: str - :ivar value: - :vartype value: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - :keyword value: - :paramtype value: str - """ - super(StringKeyValuePair, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.value = kwargs.get('value', None) - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_trials = kwargs.get('max_trials', 1000) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) - - -class TeacherModelEndpoint(msrest.serialization.Model): - """TeacherModelEndpoint. - - :ivar endpoint_name: - :vartype endpoint_name: str - """ - - _attribute_map = { - 'endpoint_name': {'key': 'endpointName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword endpoint_name: - :paramtype endpoint_name: str - """ - super(TeacherModelEndpoint, self).__init__(**kwargs) - self.endpoint_name = kwargs.get('endpoint_name', None) - - -class TeacherModelEndpointRequestSettings(msrest.serialization.Model): - """TeacherModelEndpointRequestSettings. - - :ivar min_endpoint_success_ratio: - :vartype min_endpoint_success_ratio: float - :ivar request_batch_size: - :vartype request_batch_size: int - """ - - _attribute_map = { - 'min_endpoint_success_ratio': {'key': 'minEndpointSuccessRatio', 'type': 'float'}, - 'request_batch_size': {'key': 'requestBatchSize', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_endpoint_success_ratio: - :paramtype min_endpoint_success_ratio: float - :keyword request_batch_size: - :paramtype request_batch_size: int - """ - super(TeacherModelEndpointRequestSettings, self).__init__(**kwargs) - self.min_endpoint_success_ratio = kwargs.get('min_endpoint_success_ratio', None) - self.request_batch_size = kwargs.get('request_batch_size', None) - - -class TeacherModelSettings(msrest.serialization.Model): - """TeacherModelSettings. - - :ivar teacher_model_endpoint_request_settings: Teacher Model Request Settings. - :vartype teacher_model_endpoint_request_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpointRequestSettings - :ivar teacher_model_inference_parameters: Teacher Model Inference Settings. - :vartype teacher_model_inference_parameters: dict[str, str] - """ - - _attribute_map = { - 'teacher_model_endpoint_request_settings': {'key': 'teacherModelEndpointRequestSettings', 'type': 'TeacherModelEndpointRequestSettings'}, - 'teacher_model_inference_parameters': {'key': 'teacherModelInferenceParameters', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword teacher_model_endpoint_request_settings: Teacher Model Request Settings. - :paramtype teacher_model_endpoint_request_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpointRequestSettings - :keyword teacher_model_inference_parameters: Teacher Model Inference Settings. - :paramtype teacher_model_inference_parameters: dict[str, str] - """ - super(TeacherModelSettings, self).__init__(**kwargs) - self.teacher_model_endpoint_request_settings = kwargs.get('teacher_model_endpoint_request_settings', None) - self.teacher_model_inference_parameters = kwargs.get('teacher_model_inference_parameters', None) - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = kwargs.get('top', 10) - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = kwargs.get('limit', None) - self.unit = None - self.status = kwargs.get('status', None) - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageAndQuotaDetails(msrest.serialization.Model): - """UsageAndQuotaDetails. - - :ivar model_collection: Model collection name. - :vartype model_collection: str - :ivar quota: The total number of quota. - :vartype quota: long - :ivar usage_details: Usage details for each deployment. - :vartype usage_details: list[~azure.mgmt.machinelearningservices.models.PTUDeploymentUsage] - """ - - _attribute_map = { - 'model_collection': {'key': 'modelCollection', 'type': 'str'}, - 'quota': {'key': 'quota', 'type': 'long'}, - 'usage_details': {'key': 'usageDetails', 'type': '[PTUDeploymentUsage]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword model_collection: Model collection name. - :paramtype model_collection: str - :keyword quota: The total number of quota. - :paramtype quota: long - :keyword usage_details: Usage details for each deployment. - :paramtype usage_details: list[~azure.mgmt.machinelearningservices.models.PTUDeploymentUsage] - """ - super(UsageAndQuotaDetails, self).__init__(**kwargs) - self.model_collection = kwargs.get('model_collection', None) - self.quota = kwargs.get('quota', None) - self.usage_details = kwargs.get('usage_details', None) - - -class UsageAndQuotaDetailsArmPaginatedResult(msrest.serialization.Model): - """A paginated list of UsageAndQuotaDetails entities. - - :ivar next_link: The link to the next page of UsageAndQuotaDetails objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type UsageAndQuotaDetails. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UsageAndQuotaDetails] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[UsageAndQuotaDetails]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of UsageAndQuotaDetails objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type UsageAndQuotaDetails. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.UsageAndQuotaDetails] - """ - super(UsageAndQuotaDetailsArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) - - -class VulnerabilityDetails(msrest.serialization.Model): - """VulnerabilityDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cve: CVE id. - :vartype cve: str - :ivar cve_url: CVE url. - :vartype cve_url: str - :ivar due_date: DueDate for vulnerability. Provider data or PublishDate + 30 days. - :vartype due_date: ~datetime.datetime - :ivar id: Vulnerability ID. - :vartype id: str - :ivar package_details: Dependency details. - :vartype package_details: list[~azure.mgmt.machinelearningservices.models.PackageDetails] - :ivar patchable: Indicates if there is a known patch for vulnerability. - :vartype patchable: bool - :ivar provider_id: Vulnerability ID from provider. - :vartype provider_id: str - :ivar publish_date: Vulnerability publish date. - :vartype publish_date: ~datetime.datetime - :ivar risk: Vulnerability Risk value. Possible values include: "UNKNOWN", "CRITICAL", "HIGH", - "MEDIUM", "LOW". - :vartype risk: str or ~azure.mgmt.machinelearningservices.models.VulnerabilityRisk - :ivar solution: Vulnerability description. - :vartype solution: str - :ivar title: Vulnerability name. - :vartype title: str - :ivar vendor_id: Vendor vulnerability ID (USN, GH Advisory, etc). - :vartype vendor_id: str - :ivar vendor_url: Vendor vulnerability url. - :vartype vendor_url: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'cve': {'key': 'cve', 'type': 'str'}, - 'cve_url': {'key': 'cveUrl', 'type': 'str'}, - 'due_date': {'key': 'dueDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'package_details': {'key': 'packageDetails', 'type': '[PackageDetails]'}, - 'patchable': {'key': 'patchable', 'type': 'bool'}, - 'provider_id': {'key': 'providerId', 'type': 'str'}, - 'publish_date': {'key': 'publishDate', 'type': 'iso-8601'}, - 'risk': {'key': 'risk', 'type': 'str'}, - 'solution': {'key': 'solution', 'type': 'str'}, - 'title': {'key': 'title', 'type': 'str'}, - 'vendor_id': {'key': 'vendorId', 'type': 'str'}, - 'vendor_url': {'key': 'vendorUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cve: CVE id. - :paramtype cve: str - :keyword cve_url: CVE url. - :paramtype cve_url: str - :keyword due_date: DueDate for vulnerability. Provider data or PublishDate + 30 days. - :paramtype due_date: ~datetime.datetime - :keyword package_details: Dependency details. - :paramtype package_details: list[~azure.mgmt.machinelearningservices.models.PackageDetails] - :keyword patchable: Indicates if there is a known patch for vulnerability. - :paramtype patchable: bool - :keyword provider_id: Vulnerability ID from provider. - :paramtype provider_id: str - :keyword publish_date: Vulnerability publish date. - :paramtype publish_date: ~datetime.datetime - :keyword risk: Vulnerability Risk value. Possible values include: "UNKNOWN", "CRITICAL", - "HIGH", "MEDIUM", "LOW". - :paramtype risk: str or ~azure.mgmt.machinelearningservices.models.VulnerabilityRisk - :keyword solution: Vulnerability description. - :paramtype solution: str - :keyword title: Vulnerability name. - :paramtype title: str - :keyword vendor_id: Vendor vulnerability ID (USN, GH Advisory, etc). - :paramtype vendor_id: str - :keyword vendor_url: Vendor vulnerability url. - :paramtype vendor_url: str - """ - super(VulnerabilityDetails, self).__init__(**kwargs) - self.cve = kwargs.get('cve', None) - self.cve_url = kwargs.get('cve_url', None) - self.due_date = kwargs.get('due_date', None) - self.id = None - self.package_details = kwargs.get('package_details', None) - self.patchable = kwargs.get('patchable', None) - self.provider_id = kwargs.get('provider_id', None) - self.publish_date = kwargs.get('publish_date', None) - self.risk = kwargs.get('risk', None) - self.solution = kwargs.get('solution', None) - self.title = kwargs.get('title', None) - self.vendor_id = kwargs.get('vendor_id', None) - self.vendor_url = kwargs.get('vendor_url', None) - - -class VulnerabilityFindings(msrest.serialization.Model): - """VulnerabilityFindings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar asset_id: AssetId (Image digest). - :vartype asset_id: str - :ivar critical_findings_count: Number of critical findings. - :vartype critical_findings_count: int - :ivar data: List of vulnerability findings. - :vartype data: list[~azure.mgmt.machinelearningservices.models.VulnerabilityDetails] - :ivar generated_time: Time the report was generated. - :vartype generated_time: ~datetime.datetime - :ivar high_findings_count: Number of high findings. - :vartype high_findings_count: int - :ivar last_scan_date: Scan result date. - :vartype last_scan_date: ~datetime.datetime - :ivar scanner: Vulnerability scanner name. - :vartype scanner: str - :ivar source: Data source (internal). - :vartype source: str - :ivar total_findings_count: Total findings count. - :vartype total_findings_count: int - """ - - _validation = { - 'critical_findings_count': {'readonly': True}, - 'high_findings_count': {'readonly': True}, - 'total_findings_count': {'readonly': True}, - } - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'critical_findings_count': {'key': 'criticalFindingsCount', 'type': 'int'}, - 'data': {'key': 'data', 'type': '[VulnerabilityDetails]'}, - 'generated_time': {'key': 'generatedTime', 'type': 'iso-8601'}, - 'high_findings_count': {'key': 'highFindingsCount', 'type': 'int'}, - 'last_scan_date': {'key': 'lastScanDate', 'type': 'iso-8601'}, - 'scanner': {'key': 'scanner', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'total_findings_count': {'key': 'totalFindingsCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword asset_id: AssetId (Image digest). - :paramtype asset_id: str - :keyword data: List of vulnerability findings. - :paramtype data: list[~azure.mgmt.machinelearningservices.models.VulnerabilityDetails] - :keyword generated_time: Time the report was generated. - :paramtype generated_time: ~datetime.datetime - :keyword last_scan_date: Scan result date. - :paramtype last_scan_date: ~datetime.datetime - :keyword scanner: Vulnerability scanner name. - :paramtype scanner: str - :keyword source: Data source (internal). - :paramtype source: str - """ - super(VulnerabilityFindings, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.critical_findings_count = None - self.data = kwargs.get('data', None) - self.generated_time = kwargs.get('generated_time', None) - self.high_findings_count = None - self.last_scan_date = kwargs.get('last_scan_date', None) - self.scanner = kwargs.get('scanner', None) - self.source = kwargs.get('source', None) - self.total_findings_count = None - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar agents_endpoint_uri: The URI of agents endpoint associated with this workspace. - :vartype agents_endpoint_uri: str - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment for - the workspace MSI on resource group level. - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_service_side_cmk_encryption: - :vartype enable_service_side_cmk_encryption: bool - :ivar enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :vartype enable_simplified_cmk: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar network_acls: A set of rules governing the network accessibility of the workspace. - :vartype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provision_network_now: Set to trigger the provisioning of the managed VNet with the - default Options when creating a Workspace with the managed VNet enabled, or else it does - nothing. - :vartype provision_network_now: bool - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :vartype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'agents_endpoint_uri': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'agents_endpoint_uri': {'key': 'properties.agentsEndpointUri', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_service_side_cmk_encryption': {'key': 'properties.enableServiceSideCMKEncryption', 'type': 'bool'}, - 'enable_simplified_cmk': {'key': 'properties.enableSimplifiedCmk', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'network_acls': {'key': 'properties.networkAcls', 'type': 'NetworkAcls'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provision_network_now': {'key': 'properties.provisionNetworkNow', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment - for the workspace MSI on resource group level. - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_service_side_cmk_encryption: - :paramtype enable_service_side_cmk_encryption: bool - :keyword enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :paramtype enable_simplified_cmk: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword network_acls: A set of rules governing the network accessibility of the workspace. - :paramtype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword provision_network_now: Set to trigger the provisioning of the managed VNet with the - default Options when creating a Workspace with the managed VNet enabled, or else it does - nothing. - :paramtype provision_network_now: bool - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :paramtype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.agents_endpoint_uri = None - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', None) - self.allow_role_assignment_on_rg = kwargs.get('allow_role_assignment_on_rg', None) - self.application_insights = kwargs.get('application_insights', None) - self.associated_workspaces = kwargs.get('associated_workspaces', None) - self.container_registries = kwargs.get('container_registries', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_service_side_cmk_encryption = kwargs.get('enable_service_side_cmk_encryption', None) - self.enable_simplified_cmk = kwargs.get('enable_simplified_cmk', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.existing_workspaces = kwargs.get('existing_workspaces', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.hbi_workspace = kwargs.get('hbi_workspace', None) - self.hub_resource_id = kwargs.get('hub_resource_id', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.key_vault = kwargs.get('key_vault', None) - self.key_vaults = kwargs.get('key_vaults', None) - self.managed_network = kwargs.get('managed_network', None) - self.ml_flow_tracking_uri = None - self.network_acls = kwargs.get('network_acls', None) - self.notebook_info = None - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.private_endpoint_connections = None - self.private_link_count = None - self.provision_network_now = kwargs.get('provision_network_now', None) - self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.service_provisioned_resource_group = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.storage_account = kwargs.get('storage_account', None) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.storage_hns_enabled = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.tenant_id = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) - self.workspace_hub_config = kwargs.get('workspace_hub_config', None) - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) - - -class WorkspaceConnectionAccountKey(msrest.serialization.Model): - """Account key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionAccountKey, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.resource_id = kwargs.get('resource_id', None) - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = kwargs.get('auth_url', None) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.developer_token = kwargs.get('developer_token', None) - self.password = kwargs.get('password', None) - self.refresh_token = kwargs.get('refresh_token', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.username = kwargs.get('username', None) - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = kwargs.get('password', None) - self.security_token = kwargs.get('security_token', None) - self.username = kwargs.get('username', None) - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = kwargs.get('additional_workspace_storage_accounts', None) - self.default_workspace_resource_group = kwargs.get('default_workspace_resource_group', None) - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar allow_role_assignment_on_rg: - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar network_acls: A set of rules governing the network accessibility of the workspace. - :vartype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :vartype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'network_acls': {'key': 'properties.networkAcls', 'type': 'NetworkAcls'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword allow_role_assignment_on_rg: - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword network_acls: A set of rules governing the network accessibility of the workspace. - :paramtype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :paramtype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.allow_role_assignment_on_rg = kwargs.get('allow_role_assignment_on_rg', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.description = kwargs.get('description', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', None) - self.enable_software_bill_of_materials = kwargs.get('enable_software_bill_of_materials', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.ip_allowlist = kwargs.get('ip_allowlist', None) - self.managed_network = kwargs.get('managed_network', None) - self.network_acls = kwargs.get('network_acls', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models_py3.py deleted file mode 100644 index 3797e844dadc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/models/_models_py3.py +++ /dev/null @@ -1,37001 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - _subtype_map = { - 'auth_type': {'AAD': 'AADAuthTypeWorkspaceConnectionProperties', 'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'AccountKey': 'AccountKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'OAuth2': 'OAuth2AuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = category - self.created_by_workspace_arm_id = None - self.error = error - self.expiry_time = expiry_time - self.group = None - self.is_shared_to_all = is_shared_to_all - self.metadata = metadata - self.pe_requirement = pe_requirement - self.pe_status = pe_status - self.shared_user_list = shared_user_list - self.target = target - self.use_workspace_managed_identity = use_workspace_managed_identity - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the AAD auth for any applicable Azure service. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(AADAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'AAD' # type: str - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = credentials - - -class AccountApiKeys(msrest.serialization.Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__( - self, - *, - key1: Optional[str] = None, - key2: Optional[str] = None, - **kwargs - ): - """ - :keyword key1: - :paramtype key1: str - :keyword key2: - :paramtype key2: str - """ - super(AccountApiKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 - - -class AccountKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the account key connection for Azure storage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Account key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccountKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionAccountKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Account key object for workspace connection credential. - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccountKey - """ - super(AccountKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'AccountKey' # type: str - self.credentials = credentials - - -class DatastoreCredentials(msrest.serialization.Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, NoneDatastoreCredentials, SasDatastoreCredentials, ServicePrincipalDatastoreCredentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = None # type: Optional[str] - - -class AccountKeyDatastoreCredentials(DatastoreCredentials): - """Account key datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage account secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage account secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets - """ - super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = secrets - - -class DatastoreSecrets(msrest.serialization.Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, SasDatastoreSecrets, ServicePrincipalDatastoreSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - } - - _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = None # type: Optional[str] - - -class AccountKeyDatastoreSecrets(DatastoreSecrets): - """Datastore account key secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar key: Storage account key. - :vartype key: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: Storage account key. - :paramtype key: str - """ - super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = key - - -class AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :vartype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - - _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, - } - - def __init__( - self, - *, - system_created_acr_account: Optional["SystemCreatedAcrAccount"] = None, - user_created_acr_account: Optional["UserCreatedAcrAccount"] = None, - **kwargs - ): - """ - :keyword system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: Details of user created ACR account to be used for the - Registry. - :paramtype user_created_acr_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount - """ - super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = system_created_acr_account - self.user_created_acr_account = user_created_acr_account - - -class ActualCapacityInfo(msrest.serialization.Model): - """ActualCapacityInfo. - - :ivar total: Gets or sets the total number of instances (scale units) regardless of - provisioning state or whether current group payload version matches the target group payload. - :vartype total: int - :ivar succeeded: Gets or sets the number of instances (scale units) which have Succeeded - provisioning state and target group payload. - :vartype succeeded: int - :ivar failed: Gets or sets the number of instances (scale units) which have Failed provisioning - state and have target group payload. - :vartype failed: int - :ivar outdated_succeeded: Gets or sets the number of instances (scale units) which have - Succeeded provisioning state but do not have target group payload. - :vartype outdated_succeeded: int - :ivar outdated_failed: Gets or sets the number of instances (scale units) which have Failed - provisioning state but do not have target group payload. - :vartype outdated_failed: int - """ - - _attribute_map = { - 'total': {'key': 'total', 'type': 'int'}, - 'succeeded': {'key': 'succeeded', 'type': 'int'}, - 'failed': {'key': 'failed', 'type': 'int'}, - 'outdated_succeeded': {'key': 'outdatedSucceeded', 'type': 'int'}, - 'outdated_failed': {'key': 'outdatedFailed', 'type': 'int'}, - } - - def __init__( - self, - *, - total: Optional[int] = 0, - succeeded: Optional[int] = 0, - failed: Optional[int] = 0, - outdated_succeeded: Optional[int] = 0, - outdated_failed: Optional[int] = 0, - **kwargs - ): - """ - :keyword total: Gets or sets the total number of instances (scale units) regardless of - provisioning state or whether current group payload version matches the target group payload. - :paramtype total: int - :keyword succeeded: Gets or sets the number of instances (scale units) which have Succeeded - provisioning state and target group payload. - :paramtype succeeded: int - :keyword failed: Gets or sets the number of instances (scale units) which have Failed - provisioning state and have target group payload. - :paramtype failed: int - :keyword outdated_succeeded: Gets or sets the number of instances (scale units) which have - Succeeded provisioning state but do not have target group payload. - :paramtype outdated_succeeded: int - :keyword outdated_failed: Gets or sets the number of instances (scale units) which have Failed - provisioning state but do not have target group payload. - :paramtype outdated_failed: int - """ - super(ActualCapacityInfo, self).__init__(**kwargs) - self.total = total - self.succeeded = succeeded - self.failed = failed - self.outdated_succeeded = outdated_succeeded - self.outdated_failed = outdated_failed - - -class AKSSchema(msrest.serialization.Model): - """AKSSchema. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - """ - super(AKSSchema, self).__init__(**kwargs) - self.properties = properties - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AKS(Compute, AKSSchema): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'AKS' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = subnet_id - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.docker_bridge_cidr = docker_bridge_cidr - - -class AKSSchemaProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", - ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", - load_balancer_subnet: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = cluster_fqdn - self.system_services = None - self.agent_count = agent_count - self.agent_vm_size = agent_vm_size - self.cluster_purpose = cluster_purpose - self.ssl_configuration = ssl_configuration - self.aks_networking_configuration = aks_networking_configuration - self.load_balancer_type = load_balancer_type - self.load_balancer_subnet = load_balancer_subnet - - -class MonitoringFeatureFilterBase(msrest.serialization.Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllFeatures, FeatureSubset, TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringFeatureFilterBase, self).__init__(**kwargs) - self.filter_type = None # type: Optional[str] - - -class AllFeatures(MonitoringFeatureFilterBase): - """AllFeatures. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str - - -class Nodes(msrest.serialization.Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AllNodes. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Nodes, self).__init__(**kwargs) - self.nodes_value_type = None # type: Optional[str] - - -class AllNodes(Nodes): - """All nodes means the service will be running on all of the nodes of the job. - - All required parameters must be populated in order to send to Azure. - - :ivar nodes_value_type: Required. [Required] Type of the Nodes value.Constant filled by server. - Possible values include: "All". - :vartype nodes_value_type: str or ~azure.mgmt.machinelearningservices.models.NodesValueType - """ - - _validation = { - 'nodes_value_type': {'required': True}, - } - - _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str - - -class AmlComputeSchema(msrest.serialization.Model): - """Properties(top level) of AmlCompute. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = properties - - -class AmlCompute(Compute, AmlComputeSchema): - """An Azure Machine Learning compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'AmlCompute' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - *, - os_type: Optional[Union[str, "OsType"]] = "Linux", - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "VmPriority"]] = None, - virtual_machine_image: Optional["VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["ScaleSettings"] = None, - user_account_credentials: Optional["UserAccountCredentials"] = None, - subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", - enable_node_public_ip: Optional[bool] = True, - property_bag: Optional[Any] = None, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - :keyword property_bag: A property bag containing additional properties. - :paramtype property_bag: any - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = os_type - self.vm_size = vm_size - self.vm_priority = vm_priority - self.virtual_machine_image = virtual_machine_image - self.isolated_network = isolated_network - self.scale_settings = scale_settings - self.user_account_credentials = user_account_credentials - self.subnet = subnet - self.remote_login_port_public_access = remote_login_port_public_access - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = enable_node_public_ip - self.property_bag = property_bag - - -class IdentityConfiguration(msrest.serialization.Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlToken, ManagedIdentity, UserIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(IdentityConfiguration, self).__init__(**kwargs) - self.identity_type = None # type: Optional[str] - - -class AmlToken(IdentityConfiguration): - """AML Token identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str - - -class MonitorComputeIdentityBase(msrest.serialization.Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AmlTokenComputeIdentity, ManagedComputeIdentity. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_identity_type': {'AmlToken': 'AmlTokenComputeIdentity', 'ManagedIdentity': 'ManagedComputeIdentity'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeIdentityBase, self).__init__(**kwargs) - self.compute_identity_type = None # type: Optional[str] - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase): - """AML token compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlTokenComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'AmlToken' # type: str - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = id - self.display_name = display_name - self.description = description - - -class DataReferenceCredential(msrest.serialization.Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'DockerCredentials': 'DockerCredential', 'ManagedIdentity': 'ManagedIdentityCredential', 'NoCredentials': 'AnonymousAccessCredential', 'SAS': 'SASCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DataReferenceCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class AnonymousAccessCredential(DataReferenceCredential): - """Access credential with no credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AnonymousAccessCredential, self).__init__(**kwargs) - self.credential_type = 'NoCredentials' # type: str - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """This connection type covers the generic ApiKey auth connection categories, for examples: -AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - -CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - -CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - -Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionApiKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'ApiKey' # type: str - self.credentials = credentials - - -class ArmResourceId(msrest.serialization.Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :paramtype resource_id: str - """ - super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = resource_id - - -class ResourceBase(msrest.serialization.Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - """ - super(ResourceBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - self.tags = tags - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_anonymous = is_anonymous - self.is_archived = is_archived - - -class AssetContainer(ResourceBase): - """AssetContainer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.is_archived = is_archived - self.latest_version = None - self.next_version = None - - -class AssetJobInput(msrest.serialization.Model): - """Asset input type. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(AssetJobInput, self).__init__(**kwargs) - self.mode = mode - self.uri = uri - - -class AssetJobOutput(msrest.serialization.Model): - """Asset output type. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - """ - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - """ - super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = asset_name - self.mode = mode - self.uri = uri - - -class AssetReferenceBase(msrest.serialization.Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataPathAssetReference, IdAssetReference, OutputPathAssetReference. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - } - - _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssetReferenceBase, self).__init__(**kwargs) - self.reference_type = None # type: Optional[str] - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = object_id - self.tenant_id = tenant_id - - -class ForecastHorizon(msrest.serialization.Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoForecastHorizon, CustomForecastHorizon. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ForecastHorizon, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoForecastHorizon(ForecastHorizon): - """Forecast horizon determined automatically by system. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoMLJob, CommandJob, DistillationJob, FineTuningJob, PipelineJob, SparkJob, SweepJob. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Distillation': 'DistillationJob', 'FineTuning': 'FineTuningJob', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.component_id = component_id - self.compute_id = compute_id - self.display_name = display_name - self.experiment_name = experiment_name - self.identity = identity - self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = notification_setting - self.parent_job_name = parent_job_name - self.services = services - self.status = None - - -class AutoMLJob(JobBaseProperties): - """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - *, - task_details: "AutoMLVertical", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :keyword task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, parent_job_name=parent_job_name, services=services, **kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = environment_id - self.environment_variables = environment_variables - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - self.task_details = task_details - - -class AutoMLVertical(msrest.serialization.Model): - """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - - All required parameters must be populated in order to send to Azure. - - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - } - - _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.task_type = None # type: Optional[str] - self.training_data = training_data - - -class NCrossValidations(msrest.serialization.Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoNCrossValidations, CustomNCrossValidations. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NCrossValidations, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoNCrossValidations(NCrossValidations): - """N-Cross validations determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = delay_in_minutes - self.enabled = enabled - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = min_node_count - self.enabled = enabled - self.max_node_count = max_node_count - - -class Seasonality(msrest.serialization.Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoSeasonality, CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Seasonality, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoSeasonality(Seasonality): - """AutoSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetLags(msrest.serialization.Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetLags, CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetLags, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetLags(TargetLags): - """AutoTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class TargetRollingWindowSize(msrest.serialization.Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutoTargetRollingWindowSize, CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(TargetRollingWindowSize, self).__init__(**kwargs) - self.mode = None # type: Optional[str] - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize): - """Target lags rolling window determined automatically. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - """ - - _validation = { - 'mode': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str - - -class AvailableQuota(msrest.serialization.Model): - """AvailableQuota. - - :ivar properties: Available quota properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AvailableQuotaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AvailableQuotaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["AvailableQuotaProperties"] = None, - **kwargs - ): - """ - :keyword properties: Available quota properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AvailableQuotaProperties - """ - super(AvailableQuota, self).__init__(**kwargs) - self.properties = properties - - -class AvailableQuotaArmPaginatedResult(msrest.serialization.Model): - """A paginated list of AvailableQuota entities. - - :ivar next_link: The link to the next page of AvailableQuota objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type AvailableQuota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AvailableQuota] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[AvailableQuota]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["AvailableQuota"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of AvailableQuota objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type AvailableQuota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AvailableQuota] - """ - super(AvailableQuotaArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class AvailableQuotaProperties(msrest.serialization.Model): - """AvailableQuotaProperties. - - :ivar total: The number of available quota. - :vartype total: long - """ - - _attribute_map = { - 'total': {'key': 'total', 'type': 'long'}, - } - - def __init__( - self, - *, - total: Optional[int] = None, - **kwargs - ): - """ - :keyword total: The number of available quota. - :paramtype total: long - """ - super(AvailableQuotaProperties, self).__init__(**kwargs) - self.total = total - - -class AzureDatastore(msrest.serialization.Model): - """Base definition for Azure datastore contents configuration. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - """ - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - """ - super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, OneLakeDatastore. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str - self.is_default = None - - -class AzureBlobDatastore(DatastoreProperties, AzureDatastore): - """Azure Blob datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Storage account name. - :paramtype account_name: str - :keyword container_name: Storage account container name. - :paramtype container_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str - self.account_name = account_name - self.container_name = container_name - self.endpoint = endpoint - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen1 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :ivar store_name: Required. [Required] Azure Data Lake store name. - :vartype store_name: str - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - store_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - :keyword store_name: Required. [Required] Azure Data Lake store name. - :paramtype store_name: str - """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): - """Azure Data Lake Gen2 datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - filesystem: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword filesystem: Required. [Required] The name of the Data Lake Gen2 filesystem. - :paramtype filesystem: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = account_name - self.endpoint = endpoint - self.filesystem = filesystem - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class Webhook(msrest.serialization.Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureDevOpsWebhook. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(Webhook, self).__init__(**kwargs) - self.event_type = event_type - self.webhook_type = None # type: Optional[str] - - -class AzureDevOpsWebhook(Webhook): - """Webhook details specific for Azure DevOps. - - All required parameters must be populated in order to send to Azure. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: Required. [Required] Specifies the type of service to send a - callback.Constant filled by server. Possible values include: "AzureDevOps". - :vartype webhook_type: str or ~azure.mgmt.machinelearningservices.models.WebhookType - """ - - _validation = { - 'webhook_type': {'required': True}, - } - - _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, - } - - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): - """ - :keyword event_type: Send callback on a specified notification event. - :paramtype event_type: str - """ - super(AzureDevOpsWebhook, self).__init__(event_type=event_type, **kwargs) - self.webhook_type = 'AzureDevOps' # type: str - - -class AzureFileDatastore(DatastoreProperties, AzureDatastore): - """Azure File datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar account_name: Required. [Required] Storage account name. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: Required. [Required] The name of the Azure file share that the datastore - points to. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - account_name: str, - file_share_name: str, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword resource_group: Azure Resource Group name. - :paramtype resource_group: str - :keyword subscription_id: Azure Subscription Id. - :paramtype subscription_id: str - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword account_name: Required. [Required] Storage account name. - :paramtype account_name: str - :keyword endpoint: Azure cloud endpoint for the storage account. - :paramtype endpoint: str - :keyword file_share_name: Required. [Required] The name of the Azure file share that the - datastore points to. - :paramtype file_share_name: str - :keyword protocol: Protocol used to communicate with the storage account. - :paramtype protocol: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) - self.resource_group = resource_group - self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str - self.account_name = account_name - self.endpoint = endpoint - self.file_share_name = file_share_name - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity - self.description = description - self.properties = properties - self.tags = tags - self.credentials = credentials - self.is_default = None - - -class FineTuningVertical(msrest.serialization.Model): - """FineTuningVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOpenAiFineTuning, CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'JobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - _subtype_map = { - 'model_provider': {'AzureOpenAI': 'AzureOpenAiFineTuning', 'Custom': 'CustomModelFineTuning'} - } - - def __init__( - self, - *, - model: "JobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FineTuningVertical, self).__init__(**kwargs) - self.model = model - self.model_provider = None # type: Optional[str] - self.task_type = task_type - self.training_data = training_data - self.validation_data = validation_data - - -class AzureOpenAiFineTuning(FineTuningVertical): - """AzureOpenAiFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :vartype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'JobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': 'AzureOpenAiHyperParameters'}, - } - - def __init__( - self, - *, - model: "JobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - hyper_parameters: Optional["AzureOpenAiHyperParameters"] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :paramtype hyper_parameters: - ~azure.mgmt.machinelearningservices.models.AzureOpenAiHyperParameters - """ - super(AzureOpenAiFineTuning, self).__init__(model=model, task_type=task_type, training_data=training_data, validation_data=validation_data, **kwargs) - self.model_provider = 'AzureOpenAI' # type: str - self.hyper_parameters = hyper_parameters - - -class AzureOpenAiHyperParameters(msrest.serialization.Model): - """Azure Open AI hyperparameters for fine tuning. - - :ivar batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :vartype batch_size: int - :ivar learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning rate - may be useful to avoid over fitting. - :vartype learning_rate_multiplier: float - :ivar n_epochs: The number of epochs to train the model for. An epoch refers to one full cycle - through the training dataset. - :vartype n_epochs: int - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'learning_rate_multiplier': {'key': 'learningRateMultiplier', 'type': 'float'}, - 'n_epochs': {'key': 'nEpochs', 'type': 'int'}, - } - - def __init__( - self, - *, - batch_size: Optional[int] = None, - learning_rate_multiplier: Optional[float] = None, - n_epochs: Optional[int] = None, - **kwargs - ): - """ - :keyword batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :paramtype batch_size: int - :keyword learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning - rate may be useful to avoid over fitting. - :paramtype learning_rate_multiplier: float - :keyword n_epochs: The number of epochs to train the model for. An epoch refers to one full - cycle through the training dataset. - :paramtype n_epochs: int - """ - super(AzureOpenAiHyperParameters, self).__init__(**kwargs) - self.batch_size = batch_size - self.learning_rate_multiplier = learning_rate_multiplier - self.n_epochs = n_epochs - - -class EarlyTerminationPolicy(msrest.serialization.Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = delay_evaluation - self.evaluation_interval = evaluation_interval - self.policy_type = None # type: Optional[str] - - -class BanditPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - slack_amount: Optional[float] = 0, - slack_factor: Optional[float] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword slack_amount: Absolute distance allowed from the best performing run. - :paramtype slack_amount: float - :keyword slack_factor: Ratio of the allowed distance from the best performing run. - :paramtype slack_factor: float - """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = slack_amount - self.slack_factor = slack_factor - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class BatchDeployment(TrackedResource): - """BatchDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchDeploymentConfiguration(msrest.serialization.Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BatchPipelineComponentDeploymentConfiguration. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - } - - _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BatchDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = None # type: Optional[str] - - -class EndpointDeploymentPropertiesBase(msrest.serialization.Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = code_configuration - self.description = description - self.environment_id = environment_id - self.environment_variables = environment_variables - self.properties = properties - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :vartype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :vartype mini_batch_size: long - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :ivar output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :vartype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :vartype resources: ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - deployment_configuration: Optional["BatchDeploymentConfiguration"] = None, - error_threshold: Optional[int] = -1, - logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = 1, - mini_batch_size: Optional[int] = 10, - model: Optional["AssetReferenceBase"] = None, - output_action: Optional[Union[str, "BatchOutputAction"]] = None, - output_file_name: Optional[str] = "predictions.csv", - resources: Optional["DeploymentResourceConfiguration"] = None, - retry_settings: Optional["BatchRetrySettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: Compute target for batch inference operation. - :paramtype compute: str - :keyword deployment_configuration: Properties relevant to different deployment types. - :paramtype deployment_configuration: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfiguration - :keyword error_threshold: Error threshold, if the error count for the entire input goes above - this value, - the batch inference will be aborted. Range is [-1, int.MaxValue]. - For FileDataset, this value is the count of file failures. - For TabularDataset, this value is the count of record failures. - If set to -1 (the lower bound), all failures during batch inference will be ignored. - :paramtype error_threshold: int - :keyword logging_level: Logging level for batch inference operation. Possible values include: - "Info", "Warning", "Debug". - :paramtype logging_level: str or ~azure.mgmt.machinelearningservices.models.BatchLoggingLevel - :keyword max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :paramtype max_concurrency_per_instance: int - :keyword mini_batch_size: Size of the mini-batch passed to each batch invocation. - For FileDataset, this is the number of files per mini-batch. - For TabularDataset, this is the size of the records in bytes, per mini-batch. - :paramtype mini_batch_size: long - :keyword model: Reference to the model asset for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.AssetReferenceBase - :keyword output_action: Indicates how the output will be organized. Possible values include: - "SummaryOnly", "AppendRow". - :paramtype output_action: str or ~azure.mgmt.machinelearningservices.models.BatchOutputAction - :keyword output_file_name: Customized output file name for append_row output action. - :paramtype output_file_name: str - :keyword resources: Indicates compute configuration for the job. - If not provided, will default to the defaults defined in ResourceConfiguration. - :paramtype resources: - ~azure.mgmt.machinelearningservices.models.DeploymentResourceConfiguration - :keyword retry_settings: Retry Settings for the batch inference operation. - If not provided, will default to the defaults defined in BatchRetrySettings. - :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings - """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.compute = compute - self.deployment_configuration = deployment_configuration - self.error_threshold = error_threshold - self.logging_level = logging_level - self.max_concurrency_per_instance = max_concurrency_per_instance - self.mini_batch_size = mini_batch_size - self.model = model - self.output_action = output_action - self.output_file_name = output_file_name - self.provisioning_state = None - self.resources = resources - self.retry_settings = retry_settings - - -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchDeployment entities. - - :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] - """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchEndpoint(TrackedResource): - """BatchEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "BatchEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class BatchEndpointDefaults(msrest.serialization.Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - } - - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_name: Name of the deployment that will be default for the endpoint. - This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :paramtype deployment_name: str - """ - super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = deployment_name - - -class EndpointPropertiesBase(msrest.serialization.Model): - """Inference Endpoint base definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] The authentication method for invoking the endpoint (data - plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine - Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] The authentication method for invoking the endpoint - (data plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure - Machine Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.description = description - self.keys = keys - self.properties = properties - self.scoring_uri = None - self.swagger_uri = None - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] The authentication method for invoking the endpoint (data - plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine - Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] The authentication method for invoking the endpoint - (data plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure - Machine Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword defaults: Default values for Batch Endpoint. - :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults - """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.defaults = defaults - self.provisioning_state = None - - -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of BatchEndpoint entities. - - :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type BatchEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["BatchEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type BatchEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_configuration_type: Required. [Required] The type of the deployment.Constant - filled by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentConfigurationType - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: A set of tags. The tags which will be applied to the job. - :vartype tags: dict[str, str] - """ - - _validation = { - 'deployment_configuration_type': {'required': True}, - } - - _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - component_id: Optional["IdAssetReference"] = None, - description: Optional[str] = None, - settings: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword component_id: The ARM id of the component to be run. - :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference - :keyword description: The description which will be applied to the job. - :paramtype description: str - :keyword settings: Run-time settings for the pipeline job. - :paramtype settings: dict[str, str] - :keyword tags: A set of tags. The tags which will be applied to the job. - :paramtype tags: dict[str, str] - """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = component_id - self.description = description - self.settings = settings - self.tags = tags - - -class BatchRetrySettings(msrest.serialization.Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = 3, - timeout: Optional[datetime.timedelta] = "PT30S", - **kwargs - ): - """ - :keyword max_retries: Maximum retry count for a mini-batch. - :paramtype max_retries: int - :keyword timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = max_retries - self.timeout = timeout - - -class SamplingAlgorithm(msrest.serialization.Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = None # type: Optional[str] - - -class BayesianSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values based on previous values. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str - - -class BindOptions(msrest.serialization.Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, - } - - def __init__( - self, - *, - propagation: Optional[str] = None, - create_host_path: Optional[bool] = None, - selinux: Optional[str] = None, - **kwargs - ): - """ - :keyword propagation: Type of Bind Option. - :paramtype propagation: str - :keyword create_host_path: Indicate whether to create host path. - :paramtype create_host_path: bool - :keyword selinux: Mention the selinux options. - :paramtype selinux: str - """ - super(BindOptions, self).__init__(**kwargs) - self.propagation = propagation - self.create_host_path = create_host_path - self.selinux = selinux - - -class BlobReferenceForConsumptionDto(msrest.serialization.Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["PendingUploadCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob URI path for client to upload data. - Example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialDto - :keyword storage_account_arm_id: Arm ID of the storage account to use. - :paramtype storage_account_arm_id: str - """ - super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class BuildContext(msrest.serialization.Model): - """Configuration settings for Docker build context. - - All required parameters must be populated in order to send to Azure. - - :ivar context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :vartype dockerfile_path: str - """ - - _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, - } - - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = "Dockerfile", - **kwargs - ): - """ - :keyword context_uri: Required. [Required] URI of the Docker build context used to build the - image. Supports blob URIs on environment creation and may return blob or Git URIs. - - - .. raw:: html - - . - :paramtype context_uri: str - :keyword dockerfile_path: Path to the Dockerfile in the build context. - - - .. raw:: html - - . - :paramtype dockerfile_path: str - """ - super(BuildContext, self).__init__(**kwargs) - self.context_uri = context_uri - self.dockerfile_path = dockerfile_path - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class CapabilityHost(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CapabilityHostProperties'}, - } - - def __init__( - self, - *, - properties: "CapabilityHostProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties - """ - super(CapabilityHost, self).__init__(**kwargs) - self.properties = properties - - -class CapabilityHostProperties(ResourceBase): - """CapabilityHostProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar ai_services_connections: List of AI services connections. - :vartype ai_services_connections: list[str] - :ivar capability_host_kind: Kind of this capability host. Possible values include: "Agents". - :vartype capability_host_kind: str or - ~azure.mgmt.machinelearningservices.models.CapabilityHostKind - :ivar customer_subnet: Customer subnet info to help set up this capability host. - :vartype customer_subnet: str - :ivar provisioning_state: Provisioning state for the CapabilityHost. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.CapabilityHostProvisioningState - :ivar storage_connections: List of Storage connections. - :vartype storage_connections: list[str] - :ivar thread_storage_connections: List of Thread storage connections. - :vartype thread_storage_connections: list[str] - :ivar vector_store_connections: List of VectorStore connections. - :vartype vector_store_connections: list[str] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'ai_services_connections': {'key': 'aiServicesConnections', 'type': '[str]'}, - 'capability_host_kind': {'key': 'capabilityHostKind', 'type': 'str'}, - 'customer_subnet': {'key': 'customerSubnet', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'storage_connections': {'key': 'storageConnections', 'type': '[str]'}, - 'thread_storage_connections': {'key': 'threadStorageConnections', 'type': '[str]'}, - 'vector_store_connections': {'key': 'vectorStoreConnections', 'type': '[str]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - ai_services_connections: Optional[List[str]] = None, - capability_host_kind: Optional[Union[str, "CapabilityHostKind"]] = None, - customer_subnet: Optional[str] = None, - storage_connections: Optional[List[str]] = None, - thread_storage_connections: Optional[List[str]] = None, - vector_store_connections: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword ai_services_connections: List of AI services connections. - :paramtype ai_services_connections: list[str] - :keyword capability_host_kind: Kind of this capability host. Possible values include: "Agents". - :paramtype capability_host_kind: str or - ~azure.mgmt.machinelearningservices.models.CapabilityHostKind - :keyword customer_subnet: Customer subnet info to help set up this capability host. - :paramtype customer_subnet: str - :keyword storage_connections: List of Storage connections. - :paramtype storage_connections: list[str] - :keyword thread_storage_connections: List of Thread storage connections. - :paramtype thread_storage_connections: list[str] - :keyword vector_store_connections: List of VectorStore connections. - :paramtype vector_store_connections: list[str] - """ - super(CapabilityHostProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.ai_services_connections = ai_services_connections - self.capability_host_kind = capability_host_kind - self.customer_subnet = customer_subnet - self.provisioning_state = None - self.storage_connections = storage_connections - self.thread_storage_connections = thread_storage_connections - self.vector_store_connections = vector_store_connections - - -class CapacityConfig(msrest.serialization.Model): - """The capacity configuration. - - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] - """ - - _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'step': {'key': 'step', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'allowed_values': {'key': 'allowedValues', 'type': '[int]'}, - } - - def __init__( - self, - *, - minimum: Optional[int] = None, - maximum: Optional[int] = None, - step: Optional[int] = None, - default: Optional[int] = None, - allowed_values: Optional[List[int]] = None, - **kwargs - ): - """ - :keyword minimum: The minimum capacity. - :paramtype minimum: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - :keyword step: The minimal incremental between allowed values for capacity. - :paramtype step: int - :keyword default: The default capacity. - :paramtype default: int - :keyword allowed_values: The array of allowed values for capacity. - :paramtype allowed_values: list[int] - """ - super(CapacityConfig, self).__init__(**kwargs) - self.minimum = minimum - self.maximum = maximum - self.step = step - self.default = default - self.allowed_values = allowed_values - - -class DataDriftMetricThresholdBase(msrest.serialization.Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """CategoricalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric - """ - super(CategoricalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class DataQualityMetricThresholdBase(msrest.serialization.Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(DataQualityMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """CategoricalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical data quality metric to calculate. - Possible values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric - """ - super(CategoricalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class PredictionDriftMetricThresholdBase(msrest.serialization.Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'data_type': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} - } - - def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) - self.data_type = None # type: Optional[str] - self.threshold = threshold - - -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """CategoricalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "CategoricalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The categorical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "PearsonsChiSquaredTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric - """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str - self.metric = metric - - -class CertificateDatastoreCredentials(DatastoreCredentials): - """Certificate datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - :ivar thumbprint: Required. [Required] Thumbprint of the certificate used for authentication. - :vartype thumbprint: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.CertificateDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - :keyword thumbprint: Required. [Required] Thumbprint of the certificate used for - authentication. - :paramtype thumbprint: str - """ - super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - self.thumbprint = thumbprint - - -class CertificateDatastoreSecrets(DatastoreSecrets): - """Datastore certificate secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar certificate: Service principal certificate. - :vartype certificate: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, - } - - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): - """ - :keyword certificate: Service principal certificate. - :paramtype certificate: str - """ - super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = certificate - - -class TableVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - """ - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - """ - super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - - -class Classification(AutoMLVertical, TableVertical): - """Classification task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - training_settings: Optional["ClassificationTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword positive_label: Positive label for binary metrics calculation. - :paramtype positive_label: str - :keyword primary_metric: Primary metric for the task. Possible values include: "AUCWeighted", - "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings - """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TrainingSettings(msrest.serialization.Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - """ - super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = enable_dnn_training - self.enable_model_explainability = enable_model_explainability - self.enable_onnx_compatible_models = enable_onnx_compatible_models - self.enable_stack_ensemble = enable_stack_ensemble - self.enable_vote_ensemble = enable_vote_ensemble - self.ensemble_model_download_timeout = ensemble_model_download_timeout - self.stack_ensemble_settings = stack_ensemble_settings - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for classification task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - :keyword blocked_training_algorithms: Blocked models for classification task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ClassificationModels] - """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - *, - properties: Optional["ScaleSettingsInformation"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = properties - - -class CodeConfiguration(msrest.serialization.Model): - """Configuration for a scoring code asset. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :vartype scoring_script: str - """ - - _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, - } - - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword scoring_script: Required. [Required] The script to execute on startup. eg. "score.py". - :paramtype scoring_script: str - """ - super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = code_id - self.scoring_script = scoring_script - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, - } - - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties - """ - super(CodeContainer, self).__init__(**kwargs) - self.properties = properties - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeContainer entities. - - :ivar next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] - """ - super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, - } - - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties - """ - super(CodeVersion, self).__init__(**kwargs) - self.properties = properties - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - code_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword code_uri: Uri where code is located. - :paramtype code_uri: str - """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.code_uri = code_uri - self.provisioning_state = None - - -class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of CodeVersion entities. - - :ivar next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type CodeVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["CodeVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type CodeVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] - """ - super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class CognitiveServiceEndpointDeploymentResourceProperties(msrest.serialization.Model): - """CognitiveServiceEndpointDeploymentResourceProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - - _validation = { - 'model': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - """ - super(CognitiveServiceEndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - - -class CognitiveServicesSku(msrest.serialization.Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[str] = None, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: int - :keyword family: - :paramtype family: str - :keyword name: - :paramtype name: str - :keyword size: - :paramtype size: str - :keyword tier: - :paramtype tier: str - """ - super(CognitiveServicesSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Collection(msrest.serialization.Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :vartype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "DataCollectionMode"]] = None, - data_id: Optional[str] = None, - sampling_rate: Optional[float] = 1, - **kwargs - ): - """ - :keyword client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :paramtype client_id: str - :keyword data_collection_mode: Enable or disable data collection. Possible values include: - "Enabled", "Disabled". - :paramtype data_collection_mode: str or - ~azure.mgmt.machinelearningservices.models.DataCollectionMode - :keyword data_id: The data asset arm resource id. Client side will ensure data asset is - pointing to the blob storage, and backend will collect data to the blob storage. - :paramtype data_id: str - :keyword sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect - 100% of data by default. - :paramtype sampling_rate: float - """ - super(Collection, self).__init__(**kwargs) - self.client_id = client_id - self.data_collection_mode = data_collection_mode - self.data_id = data_id - self.sampling_rate = sampling_rate - - -class ColumnTransformer(msrest.serialization.Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - } - - def __init__( - self, - *, - fields: Optional[List[str]] = None, - parameters: Optional[Any] = None, - **kwargs - ): - """ - :keyword fields: Fields to apply transformer logic on. - :paramtype fields: list[str] - :keyword parameters: Different properties to be passed to transformer. - Input expected is dictionary of key,value pairs in JSON format. - :paramtype parameters: any - """ - super(ColumnTransformer, self).__init__(**kwargs) - self.fields = fields - self.parameters = parameters - - -class CommandJob(JobBaseProperties): - """Command job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["CommandJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Command Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.CommandJobLimits - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, parent_job_name=parent_job_name, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.inputs = inputs - self.limits = limits - self.outputs = outputs - self.parameters = None - self.queue_settings = queue_settings - self.resources = resources - - -class JobLimits(msrest.serialization.Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CommandJobLimits, SweepJobLimits. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(JobLimits, self).__init__(**kwargs) - self.job_limits_type = None # type: Optional[str] - self.timeout = timeout - - -class CommandJobLimits(JobLimits): - """Command Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - """ - super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties - """ - super(ComponentContainer, self).__init__(**kwargs) - self.properties = properties - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. - - -.. raw:: html - - . - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentContainer entities. - - :ivar next_link: The link to the next page of ComponentContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] - """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties - """ - super(ComponentVersion, self).__init__(**kwargs) - self.properties = properties - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. - - - .. raw:: html - - . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - self.provisioning_state = None - - -class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ComponentVersion entities. - - :ivar next_link: The link to the next page of ComponentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ComponentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ComponentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ComponentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] - """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ComputeInstanceSchema(msrest.serialization.Model): - """Properties(top level) of ComputeInstance. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeInstance(Compute, ComputeInstanceSchema): - """An Azure Machine Learning compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["ComputeInstanceProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = display_name - self.endpoint_uri = endpoint_uri - - -class ComputeInstanceAutologgerSettings(msrest.serialization.Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible - values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, - **kwargs - ): - """ - :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. - Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MlflowAutologger - """ - super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceContainer(msrest.serialization.Model): - """Defines an Aml Instance container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :vartype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Possible values include: "Bridge", "Host". - :vartype network: str or ~azure.mgmt.machinelearningservices.models.Network - :ivar environment: Environment information of this container. - :vartype environment: ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - _validation = { - 'services': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - autosave: Optional[Union[str, "Autosave"]] = None, - gpu: Optional[str] = None, - network: Optional[Union[str, "Network"]] = None, - environment: Optional["ComputeInstanceEnvironmentInfo"] = None, - **kwargs - ): - """ - :keyword name: Name of the ComputeInstance container. - :paramtype name: str - :keyword autosave: Auto save settings. Possible values include: "None", "Local", "Remote". - :paramtype autosave: str or ~azure.mgmt.machinelearningservices.models.Autosave - :keyword gpu: Information of GPU. - :paramtype gpu: str - :keyword network: network of this container. Possible values include: "Bridge", "Host". - :paramtype network: str or ~azure.mgmt.machinelearningservices.models.Network - :keyword environment: Environment information of this container. - :paramtype environment: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo - """ - super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = name - self.autosave = autosave - self.gpu = gpu - self.network = network - self.environment = environment - self.services = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceDataDisk(msrest.serialization.Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :vartype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :vartype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - - _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - caching: Optional[Union[str, "Caching"]] = None, - disk_size_gb: Optional[int] = None, - lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", - **kwargs - ): - """ - :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", - "ReadWrite". - :paramtype caching: str or ~azure.mgmt.machinelearningservices.models.Caching - :keyword disk_size_gb: The initial disk size in gigabytes. - :paramtype disk_size_gb: int - :keyword lun: The lun is used to uniquely identify each data disk. If attaching multiple disks, - each should have a distinct lun. - :paramtype lun: int - :keyword storage_account_type: type of this storage account. Possible values include: - "Standard_LRS", "Premium_LRS". Default value: "Standard_LRS". - :paramtype storage_account_type: str or - ~azure.mgmt.machinelearningservices.models.StorageAccountType - """ - super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = caching - self.disk_size_gb = disk_size_gb - self.lun = lun - self.storage_account_type = storage_account_type - - -class ComputeInstanceDataMount(msrest.serialization.Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :vartype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :ivar mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :vartype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :vartype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :ivar mounted_on: The time when the disk mounted. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'mount_mode': {'key': 'mountMode', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, - } - - def __init__( - self, - *, - source: Optional[str] = None, - source_type: Optional[Union[str, "SourceType"]] = None, - mount_name: Optional[str] = None, - mount_action: Optional[Union[str, "MountAction"]] = None, - mount_mode: Optional[Union[str, "MountMode"]] = None, - created_by: Optional[str] = None, - mount_path: Optional[str] = None, - mount_state: Optional[Union[str, "MountState"]] = None, - mounted_on: Optional[datetime.datetime] = None, - error: Optional[str] = None, - **kwargs - ): - """ - :keyword source: Source of the ComputeInstance data mount. - :paramtype source: str - :keyword source_type: Data source type. Possible values include: "Dataset", "Datastore", "URI". - :paramtype source_type: str or ~azure.mgmt.machinelearningservices.models.SourceType - :keyword mount_name: name of the ComputeInstance data mount. - :paramtype mount_name: str - :keyword mount_action: Mount Action. Possible values include: "Mount", "Unmount". - :paramtype mount_action: str or ~azure.mgmt.machinelearningservices.models.MountAction - :keyword mount_mode: Mount Mode. Possible values include: "ReadOnly", "ReadWrite". - :paramtype mount_mode: str or ~azure.mgmt.machinelearningservices.models.MountMode - :keyword created_by: who this data mount created by. - :paramtype created_by: str - :keyword mount_path: Path of this data mount. - :paramtype mount_path: str - :keyword mount_state: Mount state. Possible values include: "MountRequested", "Mounted", - "MountFailed", "UnmountRequested", "UnmountFailed", "Unmounted". - :paramtype mount_state: str or ~azure.mgmt.machinelearningservices.models.MountState - :keyword mounted_on: The time when the disk mounted. - :paramtype mounted_on: ~datetime.datetime - :keyword error: Error of this data mount. - :paramtype error: str - """ - super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = source - self.source_type = source_type - self.mount_name = mount_name - self.mount_action = mount_action - self.mount_mode = mount_mode - self.created_by = created_by - self.mount_path = mount_path - self.mount_state = mount_state - self.mounted_on = mounted_on - self.error = error - - -class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword name: name of environment. - :paramtype name: str - :keyword version: version of environment. - :paramtype version: str - """ - super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = name - self.version = version - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Resize", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :vartype operation_trigger: str or ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_name: Optional[Union[str, "OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "OperationStatus"]] = None, - operation_trigger: Optional[Union[str, "OperationTrigger"]] = None, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Resize", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", - "ReimageFailed", "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - :keyword operation_trigger: Trigger of operation. Possible values include: "User", "Schedule", - "IdleShutdown". - :paramtype operation_trigger: str or - ~azure.mgmt.machinelearningservices.models.OperationTrigger - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = operation_name - self.operation_time = operation_time - self.operation_status = operation_status - self.operation_trigger = operation_trigger - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: ~azure.mgmt.machinelearningservices.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. Possible values are: true, false. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: ~azure.mgmt.machinelearningservices.models.ComputeInstanceVersion - """ - - _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'enable_os_patching': {'key': 'enableOSPatching', 'type': 'bool'}, - 'enable_root_access': {'key': 'enableRootAccess', 'type': 'bool'}, - 'enable_sso': {'key': 'enableSSO', 'type': 'bool'}, - 'release_quota_on_stop': {'key': 'releaseQuotaOnStop', 'type': 'bool'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, - ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - enable_os_patching: Optional[bool] = False, - enable_root_access: Optional[bool] = True, - enable_sso: Optional[bool] = True, - release_quota_on_stop: Optional[bool] = False, - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - schedules: Optional["ComputeSchedules"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword autologger_settings: Specifies settings for autologger. - :paramtype autologger_settings: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAutologgerSettings - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword custom_services: List of Custom Services added to the compute. - :paramtype custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword enable_os_patching: Enable Auto OS Patching. Possible values are: true, false. - :paramtype enable_os_patching: bool - :keyword enable_root_access: Enable root access. Possible values are: true, false. - :paramtype enable_root_access: bool - :keyword enable_sso: Enable SSO (single sign on). Possible values are: true, false. - :paramtype enable_sso: bool - :keyword release_quota_on_stop: Release quota if compute instance stopped. Possible values are: - true - release quota if compute instance stopped. false - don't release quota when compute - instance stopped. - :paramtype release_quota_on_stop: bool - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the computes. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - :keyword idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :paramtype idle_time_before_shutdown: str - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = vm_size - self.subnet = subnet - self.application_sharing_policy = application_sharing_policy - self.autologger_settings = autologger_settings - self.ssh_settings = ssh_settings - self.custom_services = custom_services - self.os_image_metadata = None - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.enable_os_patching = enable_os_patching - self.enable_root_access = enable_root_access - self.enable_sso = enable_sso - self.release_quota_on_stop = release_quota_on_stop - self.personal_compute_instance_settings = personal_compute_instance_settings - self.setup_scripts = setup_scripts - self.last_operation = None - self.schedules = schedules - self.idle_time_before_shutdown = idle_time_before_shutdown - self.enable_node_public_ip = enable_node_public_ip - self.containers = None - self.data_disks = None - self.data_mounts = None - self.versions = None - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", - admin_public_key: Optional[str] = None, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = ssh_public_access - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = admin_public_key - - -class ComputeInstanceVersion(msrest.serialization.Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, - } - - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): - """ - :keyword runtime: Runtime of compute instance. - :paramtype runtime: str - """ - super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = runtime - - -class ComputeRecurrenceSchedule(msrest.serialization.Model): - """ComputeRecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "ComputeWeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.ComputeWeekDay] - """ - super(ComputeRecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class ComputeResourceSchema(msrest.serialization.Model): - """ComputeResourceSchema. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = properties - - -class ComputeResource(Resource, ComputeResourceSchema): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(properties=properties, **kwargs) - self.properties = properties - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ComputeRuntimeDto(msrest.serialization.Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs - ): - """ - :keyword spark_runtime_version: - :paramtype spark_runtime_version: str - """ - super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = spark_runtime_version - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - *, - compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = compute_start_stop - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar action: [Required] The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ScheduleStatus"]] = None, - action: Optional[Union[str, "ComputePowerAction"]] = None, - trigger_type: Optional[Union[str, "ComputeTriggerType"]] = None, - recurrence: Optional["Recurrence"] = None, - cron: Optional["Cron"] = None, - schedule: Optional["ScheduleBase"] = None, - **kwargs - ): - """ - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword action: [Required] The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword trigger_type: [Required] The schedule trigger type. Possible values include: - "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.ComputeTriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - :keyword schedule: [Deprecated] Not used any more. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = status - self.action = action - self.trigger_type = trigger_type - self.recurrence = recurrence - self.cron = cron - self.schedule = schedule - - -class ContainerResourceRequirements(msrest.serialization.Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - - _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, - } - - def __init__( - self, - *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, - **kwargs - ): - """ - :keyword container_resource_limits: Container resource limit info:. - :paramtype container_resource_limits: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - :keyword container_resource_requests: Container resource request info:. - :paramtype container_resource_requests: - ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = container_resource_limits - self.container_resource_requests = container_resource_requests - - -class ContainerResourceSettings(msrest.serialization.Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory: str - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, - } - - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - **kwargs - ): - """ - :keyword cpu: Number of vCPUs request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: str - :keyword gpu: Number of Nvidia GPU cards request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype gpu: str - :keyword memory: Memory size request/limit for container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory: str - """ - super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = cpu - self.gpu = gpu - self.memory = memory - - -class ContentSafety(msrest.serialization.Model): - """ContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_level: [Required] Specifies the current safety level for content safety. - Possible values include: "Blocking", "Deferred". - :vartype content_safety_level: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyLevel - :ivar content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_level': {'key': 'contentSafetyLevel', 'type': 'str'}, - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - content_safety_status: Union[str, "ContentSafetyStatus"], - content_safety_level: Optional[Union[str, "ContentSafetyLevel"]] = None, - **kwargs - ): - """ - :keyword content_safety_level: [Required] Specifies the current safety level for content - safety. Possible values include: "Blocking", "Deferred". - :paramtype content_safety_level: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyLevel - :keyword content_safety_status: Required. [Required] Specifies the status of content safety. - Possible values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ContentSafety, self).__init__(**kwargs) - self.content_safety_level = content_safety_level - self.content_safety_status = content_safety_status - - -class EndpointDeploymentResourceProperties(msrest.serialization.Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Azure.ContentSafety': 'ContentSafetyEndpointDeploymentResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointDeploymentResourceProperties', 'Azure.Speech': 'SpeechEndpointDeploymentResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointDeploymentResourceProperties'} - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(EndpointDeploymentResourceProperties, self).__init__(**kwargs) - self.failure_reason = failure_reason - self.provisioning_state = None - self.type = None # type: Optional[str] - - -class ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """ContentSafetyEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(ContentSafetyEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.ContentSafety' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class EndpointResourceProperties(msrest.serialization.Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties, ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - _subtype_map = { - 'endpoint_type': {'Azure.ContentSafety': 'ContentSafetyEndpointResourceProperties', 'Azure.OpenAI': 'OpenAIEndpointResourceProperties', 'Azure.Speech': 'SpeechEndpointResourceProperties', 'managedOnlineEndpoint': 'ManagedOnlineEndpointResourceProperties', 'serverlessEndpoint': 'ServerlessEndpointResourceProperties'} - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(EndpointResourceProperties, self).__init__(**kwargs) - self.associated_resource_id = associated_resource_id - self.deployments = deployments - self.endpoint_type = None # type: Optional[str] - self.endpoint_uri = endpoint_uri - self.failure_reason = failure_reason - self.location = location - self.name = name - self.provisioning_state = None - self.should_create_ai_services_endpoint = should_create_ai_services_endpoint - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties): - """ContentSafetyEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(ContentSafetyEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.ContentSafety' # type: str - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs - ): - """ - :keyword collections_throughput: - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = collections_throughput - - -class ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, CreateMonitorAction, EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - """ - - _validation = { - 'action_type': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -class CreateMonitorAction(ScheduleActionBase): - """CreateMonitorAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar monitor_definition: Required. [Required] Defines the monitor. - :vartype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - - _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, - } - - def __init__( - self, - *, - monitor_definition: "MonitorDefinition", - **kwargs - ): - """ - :keyword monitor_definition: Required. [Required] Defines the monitor. - :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition - """ - super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = monitor_definition - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - expression: Optional[str] = None, - **kwargs - ): - """ - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = start_time - self.time_zone = time_zone - self.expression = expression - - -class TriggerBase(msrest.serialization.Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CronTrigger, RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - """ - - _validation = { - 'trigger_type': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - } - - _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} - } - - def __init__( - self, - *, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - """ - super(TriggerBase, self).__init__(**kwargs) - self.end_time = end_time - self.start_time = start_time - self.time_zone = time_zone - self.trigger_type = None # type: Optional[str] - - -class CronTrigger(TriggerBase): - """CronTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :vartype expression: str - """ - - _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - expression: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword expression: Required. [Required] Specifies cron expression of schedule. - The expression should follow NCronTab format. - :paramtype expression: str - """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = expression - - -class CustomForecastHorizon(ForecastHorizon): - """The desired maximum forecast horizon in units of time-series frequency. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set forecast horizon value selection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.ForecastHorizonMode - :ivar value: Required. [Required] Forecast horizon value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Forecast horizon value. - :paramtype value: int - """ - super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomKeys(msrest.serialization.Model): - """Custom Keys credential object. - - :ivar keys: Dictionary of :code:``. - :vartype keys: dict[str, str] - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '{str}'}, - } - - def __init__( - self, - *, - keys: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of :code:``. - :paramtype keys: dict[str, str] - """ - super(CustomKeys, self).__init__(**kwargs) - self.keys = keys - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """Category:= CustomKeys -AuthType:= CustomKeys (as type discriminator) -Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys -Target:= {any value} -Use Metadata property bag for ApiVersion and other metadata fields. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["CustomKeys"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'CustomKeys' # type: str - self.credentials = credentials - - -class CustomMetricThreshold(msrest.serialization.Model): - """CustomMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The user-defined metric to calculate. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: str, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The user-defined metric to calculate. - :paramtype metric: str - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class CustomModelFineTuning(FineTuningVertical): - """CustomModelFineTuning. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant - filled by server. Possible values include: "AzureOpenAI", "Custom". - :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider - :ivar task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :ivar training_data: Required. [Required] Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning custom model. - :vartype hyper_parameters: dict[str, str] - """ - - _validation = { - 'model': {'required': True}, - 'model_provider': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'JobInput'}, - 'model_provider': {'key': 'modelProvider', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - } - - def __init__( - self, - *, - model: "JobInput", - task_type: Union[str, "FineTuningTaskType"], - training_data: "JobInput", - validation_data: Optional["JobInput"] = None, - hyper_parameters: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", "VideoMultiObjectTracking". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.FineTuningTaskType - :keyword training_data: Required. [Required] Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword hyper_parameters: HyperParameters for fine tuning custom model. - :paramtype hyper_parameters: dict[str, str] - """ - super(CustomModelFineTuning, self).__init__(model=model, task_type=task_type, training_data=training_data, validation_data=validation_data, **kwargs) - self.model_provider = 'Custom' # type: str - self.hyper_parameters = hyper_parameters - - -class JobInput(msrest.serialization.Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, TritonModelJobInput, UriFileJobInput, UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - """ - super(JobInput, self).__init__(**kwargs) - self.description = description - self.job_input_type = None # type: Optional[str] - - -class CustomModelJobInput(JobInput, AssetJobInput): - """CustomModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'custom_model' # type: str - self.description = description - - -class JobOutput(msrest.serialization.Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, UriFileJobOutput, UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the output. - :paramtype description: str - """ - super(JobOutput, self).__init__(**kwargs) - self.description = description - self.job_output_type = None # type: Optional[str] - - -class CustomModelJobOutput(JobOutput, AssetJobOutput): - """CustomModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.mode = mode - self.uri = uri - self.job_output_type = 'custom_model' # type: str - self.description = description - - -class MonitoringSignalBase(msrest.serialization.Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, FeatureAttributionDriftMonitoringSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - } - - _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - *, - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.notification_types = notification_types - self.properties = properties - self.signal_type = None # type: Optional[str] - - -class CustomMonitoringSignal(MonitoringSignalBase): - """CustomMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] Reference to the component asset used to calculate the - custom metrics. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputDataBase}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, - } - - def __init__( - self, - *, - component_id: str, - metric_thresholds: List["CustomMetricThreshold"], - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - input_assets: Optional[Dict[str, "MonitoringInputDataBase"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] Reference to the component asset used to calculate - the custom metrics. - :paramtype component_id: str - :keyword input_assets: Monitoring assets to take as input. Key is the component input port - name, value is the data asset. - :paramtype input_assets: dict[str, - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword inputs: Extra component parameters to take as input. Key is the component literal - input port name, value is the parameter value. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] - """ - super(CustomMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = component_id - self.input_assets = input_assets - self.inputs = inputs - self.metric_thresholds = metric_thresholds - - -class CustomNCrossValidations(NCrossValidations): - """N-Cross validations are specified by user. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Mode for determining N-Cross validations.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.NCrossValidationsMode - :ivar value: Required. [Required] N-Cross validations value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] N-Cross validations value. - :paramtype value: int - """ - super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomSeasonality(Seasonality): - """CustomSeasonality. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Seasonality mode.Constant filled by server. Possible values - include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.SeasonalityMode - :ivar value: Required. [Required] Seasonality value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] Seasonality value. - :paramtype value: int - """ - super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class CustomService(msrest.serialization.Model): - """Specifies the custom service configuration. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.mgmt.machinelearningservices.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.mgmt.machinelearningservices.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, - 'kernel': {'key': 'kernel', 'type': 'JupyterKernelConfig'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - name: Optional[str] = None, - image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, - docker: Optional["Docker"] = None, - endpoints: Optional[List["Endpoint"]] = None, - volumes: Optional[List["VolumeDefinition"]] = None, - kernel: Optional["JupyterKernelConfig"] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword name: Name of the Custom Service. - :paramtype name: str - :keyword image: Describes the Image Specifications. - :paramtype image: ~azure.mgmt.machinelearningservices.models.Image - :keyword environment_variables: Environment Variable for the container. - :paramtype environment_variables: dict[str, - ~azure.mgmt.machinelearningservices.models.EnvironmentVariable] - :keyword docker: Describes the docker settings for the image. - :paramtype docker: ~azure.mgmt.machinelearningservices.models.Docker - :keyword endpoints: Configuring the endpoints for the container. - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.Endpoint] - :keyword volumes: Configuring the volumes for the container. - :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] - :keyword kernel: Describes the jupyter kernel settings for the image if its a custom - environment. - :paramtype kernel: ~azure.mgmt.machinelearningservices.models.JupyterKernelConfig - """ - super(CustomService, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.name = name - self.image = image - self.environment_variables = environment_variables - self.docker = docker - self.endpoints = endpoints - self.volumes = volumes - self.kernel = kernel - - -class CustomTargetLags(TargetLags): - """CustomTargetLags. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] Set target lags mode - Auto/Custom.Constant filled by server. - Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetLagsMode - :ivar values: Required. [Required] Set target lags values. - :vartype values: list[int] - """ - - _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, - } - - def __init__( - self, - *, - values: List[int], - **kwargs - ): - """ - :keyword values: Required. [Required] Set target lags values. - :paramtype values: list[int] - """ - super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = values - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize): - """CustomTargetRollingWindowSize. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Required. [Required] TargetRollingWindowSiz detection mode.Constant filled by - server. Possible values include: "Auto", "Custom". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSizeMode - :ivar value: Required. [Required] TargetRollingWindowSize value. - :vartype value: int - """ - - _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, - } - - def __init__( - self, - *, - value: int, - **kwargs - ): - """ - :keyword value: Required. [Required] TargetRollingWindowSize value. - :paramtype value: int - """ - super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = value - - -class DatabricksSchema(msrest.serialization.Model): - """DatabricksSchema. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(DatabricksSchema, self).__init__(**kwargs) - self.properties = properties - - -class Databricks(Compute, DatabricksSchema): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'Databricks' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) - self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - self.workspace_url = workspace_url - - -class DataCollector(msrest.serialization.Model): - """DataCollector. - - All required parameters must be populated in order to send to Azure. - - :ivar collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :vartype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :vartype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - - _validation = { - 'collections': {'required': True}, - } - - _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, - } - - def __init__( - self, - *, - collections: Dict[str, "Collection"], - request_logging: Optional["RequestLogging"] = None, - rolling_rate: Optional[Union[str, "RollingRateType"]] = None, - **kwargs - ): - """ - :keyword collections: Required. [Required] The collection configuration. Each collection has it - own configuration to collect model data and the name of collection can be arbitrary string. - Model data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. - :paramtype collections: dict[str, ~azure.mgmt.machinelearningservices.models.Collection] - :keyword request_logging: The request logging configuration for mdc, it includes advanced - logging settings for all collections. It's optional. - :paramtype request_logging: ~azure.mgmt.machinelearningservices.models.RequestLogging - :keyword rolling_rate: When model data is collected to blob storage, we need to roll the data - to different path to avoid logging all of them in a single blob file. - If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. - If it's day, all data will be collected in blob path /yyyy/MM/dd/. - The other benefit of rolling path is that model monitoring ui is able to select a time range - of data very quickly. Possible values include: "Year", "Month", "Day", "Hour", "Minute". - :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType - """ - super(DataCollector, self).__init__(**kwargs) - self.collections = collections - self.request_logging = request_logging - self.rolling_rate = rolling_rate - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, - } - - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties - """ - super(DataContainer, self).__init__(**kwargs) - self.properties = properties - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - data_type: Union[str, "DataType"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_type: Required. [Required] Specifies the type of data. Possible values include: - "uri_file", "uri_folder", "mltable". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.data_type = data_type - - -class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataContainer entities. - - :ivar next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] - """ - super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataDriftMonitoringSignal(MonitoringSignalBase): - """DataDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The feature filter which identifies which feature to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataGenerationVertical(msrest.serialization.Model): - """DataGenerationVertical. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelGeneration. - - All required parameters must be populated in order to send to Azure. - - :ivar data_generation_task_type: Required. [Required] DataGeneration Task type. Possible values - include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :vartype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :ivar data_generation_type: Required. [Required] Enum to determine the type of Data - Generation.Constant filled by server. Possible values include: "LabelGeneration", - "DataGeneration". - :vartype data_generation_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationType - :ivar prompt_settings: Prompt Settings. - :vartype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :ivar teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :vartype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :ivar teacher_model_settings: - :vartype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - """ - - _validation = { - 'data_generation_task_type': {'required': True}, - 'data_generation_type': {'required': True}, - 'teacher_model_endpoint': {'required': True}, - } - - _attribute_map = { - 'data_generation_task_type': {'key': 'dataGenerationTaskType', 'type': 'str'}, - 'data_generation_type': {'key': 'dataGenerationType', 'type': 'str'}, - 'prompt_settings': {'key': 'promptSettings', 'type': 'PromptSettings'}, - 'teacher_model_endpoint': {'key': 'teacherModelEndpoint', 'type': 'TeacherModelEndpoint'}, - 'teacher_model_settings': {'key': 'teacherModelSettings', 'type': 'TeacherModelSettings'}, - } - - _subtype_map = { - 'data_generation_type': {'LabelGeneration': 'LabelGeneration'} - } - - def __init__( - self, - *, - data_generation_task_type: Union[str, "DataGenerationTaskType"], - teacher_model_endpoint: "TeacherModelEndpoint", - prompt_settings: Optional["PromptSettings"] = None, - teacher_model_settings: Optional["TeacherModelSettings"] = None, - **kwargs - ): - """ - :keyword data_generation_task_type: Required. [Required] DataGeneration Task type. Possible - values include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :paramtype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :keyword prompt_settings: Prompt Settings. - :paramtype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :keyword teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :paramtype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :keyword teacher_model_settings: - :paramtype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - """ - super(DataGenerationVertical, self).__init__(**kwargs) - self.data_generation_task_type = data_generation_task_type - self.data_generation_type = None # type: Optional[str] - self.prompt_settings = prompt_settings - self.teacher_model_endpoint = teacher_model_endpoint - self.teacher_model_settings = teacher_model_settings - - -class DataLakeAnalyticsSchema(msrest.serialization.Model): - """DataLakeAnalyticsSchema. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - """ - super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = properties - - -class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = data_lake_store_account_name - - -class DataPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a datastore. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword datastore_id: ARM resource ID of the datastore where the asset is located. - :paramtype datastore_id: str - :keyword path: The path of the file/directory in the datastore. - :paramtype path: str - """ - super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = datastore_id - self.path = path - - -class DataQualityMonitoringSignal(MonitoringSignalBase): - """DataQualityMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :ivar production_data: Required. [Required] The data produced by the production service which - drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["DataQualityMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["FeatureImportanceSettings"] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: The settings for computing feature importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword features: The features to calculate drift over. - :paramtype features: ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterBase - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.DataQualityMetricThresholdBase] - :keyword production_data: Required. [Required] The data produced by the production service - which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(DataQualityMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, - } - - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties - """ - super(Datastore, self).__init__(**kwargs) - self.properties = properties - - -class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Datastore entities. - - :ivar next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Datastore. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Datastore"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Datastore objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Datastore. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] - """ - super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, - } - - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties - """ - super(DataVersionBase, self).__init__(**kwargs) - self.properties = properties - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLTableData, UriFileDataVersion, UriFolderDataVersion. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = data_uri - - -class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of DataVersionBase entities. - - :ivar next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type DataVersionBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["DataVersionBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type DataVersionBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] - """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineScaleSettings(msrest.serialization.Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DefaultScaleSettings, TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OnlineScaleSettings, self).__init__(**kwargs) - self.scale_type = None # type: Optional[str] - - -class DefaultScaleSettings(OnlineScaleSettings): - """DefaultScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str - - -class DeltaModelCurrentState(msrest.serialization.Model): - """Contract for DeltaModelCurrentState. - - :ivar count: Gets or sets Count of instances with model. - :vartype count: int - :ivar sample_instance_id: Gets or sets sample of instances with model. - :vartype sample_instance_id: str - :ivar status: Gets or sets status. - :vartype status: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'sample_instance_id': {'key': 'sampleInstanceID', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - count: Optional[int] = 0, - sample_instance_id: Optional[str] = None, - status: Optional[str] = None, - **kwargs - ): - """ - :keyword count: Gets or sets Count of instances with model. - :paramtype count: int - :keyword sample_instance_id: Gets or sets sample of instances with model. - :paramtype sample_instance_id: str - :keyword status: Gets or sets status. - :paramtype status: str - """ - super(DeltaModelCurrentState, self).__init__(**kwargs) - self.count = count - self.sample_instance_id = sample_instance_id - self.status = status - - -class DeltaModelListRequest(msrest.serialization.Model): - """DeltaModelListRequest. - - :ivar count: Gets or sets number of delta models to return. Default: -1, means that all will be - returned. - :vartype count: int - :ivar skip_token: Gets or sets skip token for paginated response. - :vartype skip_token: str - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'skip_token': {'key': 'skipToken', 'type': 'str'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - *, - count: Optional[int] = -1, - skip_token: Optional[str] = None, - target_base_model: Optional[str] = None, - **kwargs - ): - """ - :keyword count: Gets or sets number of delta models to return. Default: -1, means that all will - be returned. - :paramtype count: int - :keyword skip_token: Gets or sets skip token for paginated response. - :paramtype skip_token: str - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelListRequest, self).__init__(**kwargs) - self.count = count - self.skip_token = skip_token - self.target_base_model = target_base_model - - -class DeltaModelModifyRequest(msrest.serialization.Model): - """Contract base for DeltaModelChangeRequest. Used for adding or removing. - - :ivar add_delta_models: Gets or sets delta models to remove. - :vartype add_delta_models: list[str] - :ivar remove_delta_models: Gets or sets delta models to remove. - :vartype remove_delta_models: list[str] - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _validation = { - 'add_delta_models': {'unique': True}, - 'remove_delta_models': {'unique': True}, - } - - _attribute_map = { - 'add_delta_models': {'key': 'addDeltaModels', 'type': '[str]'}, - 'remove_delta_models': {'key': 'removeDeltaModels', 'type': '[str]'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - *, - add_delta_models: Optional[List[str]] = None, - remove_delta_models: Optional[List[str]] = None, - target_base_model: Optional[str] = None, - **kwargs - ): - """ - :keyword add_delta_models: Gets or sets delta models to remove. - :paramtype add_delta_models: list[str] - :keyword remove_delta_models: Gets or sets delta models to remove. - :paramtype remove_delta_models: list[str] - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelModifyRequest, self).__init__(**kwargs) - self.add_delta_models = add_delta_models - self.remove_delta_models = remove_delta_models - self.target_base_model = target_base_model - - -class DeltaModelStatusRequest(msrest.serialization.Model): - """DeltaModelStatusRequest. - - :ivar delta_models: Gets or sets collection of delta models to retrieve status for. - :vartype delta_models: list[str] - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _attribute_map = { - 'delta_models': {'key': 'deltaModels', 'type': '[str]'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - *, - delta_models: Optional[List[str]] = None, - target_base_model: Optional[str] = None, - **kwargs - ): - """ - :keyword delta_models: Gets or sets collection of delta models to retrieve status for. - :paramtype delta_models: list[str] - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelStatusRequest, self).__init__(**kwargs) - self.delta_models = delta_models - self.target_base_model = target_base_model - - -class DeltaModelStatusResponse(msrest.serialization.Model): - """Contract returning to user the delta models. - - :ivar actual_instance_count: Gets or sets actual instance count. - :vartype actual_instance_count: int - :ivar delta_models: Gets or sets dictionary representing modelID and its current state. - :vartype delta_models: dict[str, - list[~azure.mgmt.machinelearningservices.models.DeltaModelCurrentState]] - :ivar expected_instance_count: Gets or sets expected instance count. - :vartype expected_instance_count: int - :ivar revision_id: Gets or sets revision ID. - :vartype revision_id: str - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - _attribute_map = { - 'actual_instance_count': {'key': 'actualInstanceCount', 'type': 'int'}, - 'delta_models': {'key': 'deltaModels', 'type': '{[DeltaModelCurrentState]}'}, - 'expected_instance_count': {'key': 'expectedInstanceCount', 'type': 'int'}, - 'revision_id': {'key': 'revisionId', 'type': 'str'}, - 'target_base_model': {'key': 'targetBaseModel', 'type': 'str'}, - } - - def __init__( - self, - *, - actual_instance_count: Optional[int] = 0, - delta_models: Optional[Dict[str, List["DeltaModelCurrentState"]]] = None, - expected_instance_count: Optional[int] = 0, - revision_id: Optional[str] = None, - target_base_model: Optional[str] = None, - **kwargs - ): - """ - :keyword actual_instance_count: Gets or sets actual instance count. - :paramtype actual_instance_count: int - :keyword delta_models: Gets or sets dictionary representing modelID and its current state. - :paramtype delta_models: dict[str, - list[~azure.mgmt.machinelearningservices.models.DeltaModelCurrentState]] - :keyword expected_instance_count: Gets or sets expected instance count. - :paramtype expected_instance_count: int - :keyword revision_id: Gets or sets revision ID. - :paramtype revision_id: str - :keyword target_base_model: Gets or sets target base model. - :paramtype target_base_model: str - """ - super(DeltaModelStatusResponse, self).__init__(**kwargs) - self.actual_instance_count = actual_instance_count - self.delta_models = delta_models - self.expected_instance_count = expected_instance_count - self.revision_id = revision_id - self.target_base_model = target_base_model - - -class DeploymentLogs(msrest.serialization.Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - } - - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): - """ - :keyword content: The retrieved online deployment logs. - :paramtype content: str - """ - super(DeploymentLogs, self).__init__(**kwargs) - self.content = content - - -class DeploymentLogsRequest(msrest.serialization.Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :vartype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, - } - - def __init__( - self, - *, - container_type: Optional[Union[str, "ContainerType"]] = None, - tail: Optional[int] = None, - **kwargs - ): - """ - :keyword container_type: The type of container to retrieve logs from. Possible values include: - "StorageInitializer", "InferenceServer". - :paramtype container_type: str or ~azure.mgmt.machinelearningservices.models.ContainerType - :keyword tail: The maximum number of lines to tail. - :paramtype tail: int - """ - super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = container_type - self.tail = tail - - -class ResourceConfiguration(msrest.serialization.Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = instance_count - self.instance_type = instance_type - self.properties = properties - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) - - -class DestinationAsset(msrest.serialization.Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - _attribute_map = { - 'destination_name': {'key': 'destinationName', 'type': 'str'}, - 'destination_version': {'key': 'destinationVersion', 'type': 'str'}, - 'registry_name': {'key': 'registryName', 'type': 'str'}, - } - - def __init__( - self, - *, - destination_name: Optional[str] = None, - destination_version: Optional[str] = None, - registry_name: Optional[str] = None, - **kwargs - ): - """ - :keyword destination_name: Destination asset name. - :paramtype destination_name: str - :keyword destination_version: Destination asset version. - :paramtype destination_version: str - :keyword registry_name: Destination registry name. - :paramtype registry_name: str - """ - super(DestinationAsset, self).__init__(**kwargs) - self.destination_name = destination_name - self.destination_version = destination_version - self.registry_name = registry_name - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - _attribute_map = { - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - 'required_resource_providers': {'key': 'requiredResourceProviders', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'udr': {'key': 'udr', 'type': '{object}'}, - } - - def __init__( - self, - *, - application_insights: Optional[Dict[str, Any]] = None, - container_registry: Optional[Dict[str, Any]] = None, - dns_resolution: Optional[Dict[str, Any]] = None, - key_vault: Optional[Dict[str, Any]] = None, - nsg: Optional[Dict[str, Any]] = None, - others: Optional[Dict[str, Any]] = None, - required_resource_providers: Optional[Dict[str, Any]] = None, - resource_lock: Optional[Dict[str, Any]] = None, - storage_account: Optional[Dict[str, Any]] = None, - udr: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - :keyword required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :paramtype required_resource_providers: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.application_insights = application_insights - self.container_registry = container_registry - self.dns_resolution = dns_resolution - self.key_vault = key_vault - self.nsg = nsg - self.others = others - self.required_resource_providers = required_resource_providers - self.resource_lock = resource_lock - self.storage_account = storage_account - self.udr = udr - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseResponseResultValue"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = value - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - *, - user_defined_route_results: Optional[List["DiagnoseResult"]] = None, - network_security_rule_results: Optional[List["DiagnoseResult"]] = None, - resource_lock_results: Optional[List["DiagnoseResult"]] = None, - dns_resolution_results: Optional[List["DiagnoseResult"]] = None, - storage_account_results: Optional[List["DiagnoseResult"]] = None, - key_vault_results: Optional[List["DiagnoseResult"]] = None, - container_registry_results: Optional[List["DiagnoseResult"]] = None, - application_insights_results: Optional[List["DiagnoseResult"]] = None, - other_results: Optional[List["DiagnoseResult"]] = None, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = user_defined_route_results - self.network_security_rule_results = network_security_rule_results - self.resource_lock_results = resource_lock_results - self.dns_resolution_results = dns_resolution_results - self.storage_account_results = storage_account_results - self.key_vault_results = key_vault_results - self.container_registry_results = container_registry_results - self.application_insights_results = application_insights_results - self.other_results = other_results - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = value - - -class DistillationJob(JobBaseProperties): - """Distillation Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar data_generation_details: Required. [Required]. - :vartype data_generation_details: - ~azure.mgmt.machinelearningservices.models.DataGenerationVertical - :ivar finetuning_details: Required. [Required]. - :vartype finetuning_details: ~azure.mgmt.machinelearningservices.models.FinetuningDetails - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Instance types and other resources for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'data_generation_details': {'required': True}, - 'finetuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'data_generation_details': {'key': 'dataGenerationDetails', 'type': 'DataGenerationVertical'}, - 'finetuning_details': {'key': 'finetuningDetails', 'type': 'FinetuningDetails'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResources'}, - } - - def __init__( - self, - *, - data_generation_details: "DataGenerationVertical", - finetuning_details: "FinetuningDetails", - outputs: Dict[str, "JobOutput"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResources"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword data_generation_details: Required. [Required]. - :paramtype data_generation_details: - ~azure.mgmt.machinelearningservices.models.DataGenerationVertical - :keyword finetuning_details: Required. [Required]. - :paramtype finetuning_details: ~azure.mgmt.machinelearningservices.models.FinetuningDetails - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Instance types and other resources for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - super(DistillationJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, parent_job_name=parent_job_name, services=services, **kwargs) - self.job_type = 'Distillation' # type: str - self.data_generation_details = data_generation_details - self.finetuning_details = finetuning_details - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - - -class DistributionConfiguration(msrest.serialization.Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mpi, PyTorch, TensorFlow. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - } - - _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DistributionConfiguration, self).__init__(**kwargs) - self.distribution_type = None # type: Optional[str] - - -class Docker(msrest.serialization.Model): - """Docker. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - privileged: Optional[bool] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword privileged: Indicate whether container shall run in privileged or non-privileged mode. - :paramtype privileged: bool - """ - super(Docker, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.privileged = privileged - - -class DockerCredential(DataReferenceCredential): - """Credential for docker with username and password. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - user_name: Optional[str] = None, - **kwargs - ): - """ - :keyword password: DockerCredential user password. - :paramtype password: str - :keyword user_name: DockerCredential user name. - :paramtype user_name: str - """ - super(DockerCredential, self).__init__(**kwargs) - self.credential_type = 'DockerCredentials' # type: str - self.password = password - self.user_name = user_name - - -class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. - :paramtype key_identifier: str - """ - super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data - with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. KeyVault details to do the encryption. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :vartype search_account_resource_id: str - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :vartype storage_account_resource_id: str - """ - - _validation = { - 'key_vault_properties': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_vault_properties: "KeyVaultProperties", - status: Union[str, "EncryptionStatus"], - cosmos_db_resource_id: Optional[str] = None, - identity: Optional["IdentityForCmk"] = None, - search_account_resource_id: Optional[str] = None, - storage_account_resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword cosmos_db_resource_id: The byok cosmosdb account that customer brings to store - customer's data - with encryption. - :paramtype cosmos_db_resource_id: str - :keyword identity: Identity to be used with the keyVault. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. KeyVault details to do the encryption. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword search_account_resource_id: The byok search account that customer brings to store - customer's data - with encryption. - :paramtype search_account_resource_id: str - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword storage_account_resource_id: The byok storage account that customer brings to store - customer's data - with encryption. - :paramtype storage_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.cosmos_db_resource_id = cosmos_db_resource_id - self.identity = identity - self.key_vault_properties = key_vault_properties - self.search_account_resource_id = search_account_resource_id - self.status = status - self.storage_account_resource_id = storage_account_resource_id - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - - _validation = { - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, - } - - def __init__( - self, - *, - key_vault_properties: "EncryptionKeyVaultUpdateProperties", - **kwargs - ): - """ - :keyword key_vault_properties: Required. - :paramtype key_vault_properties: - ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties - """ - super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = key_vault_properties - - -class Endpoint(msrest.serialization.Model): - """Endpoint. - - :ivar protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :vartype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, - } - - def __init__( - self, - *, - protocol: Optional[Union[str, "Protocol"]] = "tcp", - name: Optional[str] = None, - target: Optional[int] = None, - published: Optional[int] = None, - host_ip: Optional[str] = None, - **kwargs - ): - """ - :keyword protocol: Protocol over which communication will happen over this endpoint. Possible - values include: "tcp", "udp", "http". Default value: "tcp". - :paramtype protocol: str or ~azure.mgmt.machinelearningservices.models.Protocol - :keyword name: Name of the Endpoint. - :paramtype name: str - :keyword target: Application port inside the container. - :paramtype target: int - :keyword published: Port over which the application is exposed from container. - :paramtype published: int - :keyword host_ip: Host IP over which the application is exposed from the container. - :paramtype host_ip: str - """ - super(Endpoint, self).__init__(**kwargs) - self.protocol = protocol - self.name = name - self.target = target - self.published = published - self.host_ip = host_ip - - -class EndpointAuthKeys(msrest.serialization.Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_key: The primary key. - :paramtype primary_key: str - :keyword secondary_key: The secondary key. - :paramtype secondary_key: str - """ - super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = primary_key - self.secondary_key = secondary_key - - -class EndpointAuthToken(msrest.serialization.Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: long - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: long - :ivar token_type: Access token type. - :vartype token_type: str - """ - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = 0, - refresh_after_time_utc: Optional[int] = 0, - token_type: Optional[str] = None, - **kwargs - ): - """ - :keyword access_token: Access token for endpoint authentication. - :paramtype access_token: str - :keyword expiry_time_utc: Access token expiry time (UTC). - :paramtype expiry_time_utc: long - :keyword refresh_after_time_utc: Refresh access token after time (UTC). - :paramtype refresh_after_time_utc: long - :keyword token_type: Access token type. - :paramtype token_type: str - """ - super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = access_token - self.expiry_time_utc = expiry_time_utc - self.refresh_after_time_utc = refresh_after_time_utc - self.token_type = token_type - - -class EndpointDeploymentModel(msrest.serialization.Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - source: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword format: Model format. - :paramtype format: str - :keyword name: Model name. - :paramtype name: str - :keyword source: Optional. Deployment model source ARM resource ID. - :paramtype source: str - :keyword version: Model version. - :paramtype version: str - """ - super(EndpointDeploymentModel, self).__init__(**kwargs) - self.format = format - self.name = name - self.source = source - self.version = version - - -class EndpointDeploymentResourcePropertiesBasicResource(Resource): - """EndpointDeploymentResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointDeploymentResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointDeploymentResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourceProperties - """ - super(EndpointDeploymentResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - """ - super(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointKeys(msrest.serialization.Model): - """EndpointKeys. - - :ivar keys: Dictionary of Keys for the endpoint. - :vartype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - - _attribute_map = { - 'keys': {'key': 'keys', 'type': 'AccountApiKeys'}, - } - - def __init__( - self, - *, - keys: Optional["AccountApiKeys"] = None, - **kwargs - ): - """ - :keyword keys: Dictionary of Keys for the endpoint. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - """ - super(EndpointKeys, self).__init__(**kwargs) - self.keys = keys - - -class EndpointModelDeprecationProperties(msrest.serialization.Model): - """EndpointModelDeprecationProperties. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: ~datetime.datetime - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: ~datetime.datetime - """ - - _attribute_map = { - 'fine_tune': {'key': 'fineTune', 'type': 'iso-8601'}, - 'inference': {'key': 'inference', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - fine_tune: Optional[datetime.datetime] = None, - inference: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword fine_tune: The datetime of deprecation of the fineTune Model. - :paramtype fine_tune: ~datetime.datetime - :keyword inference: The datetime of deprecation of the inference Model. - :paramtype inference: ~datetime.datetime - """ - super(EndpointModelDeprecationProperties, self).__init__(**kwargs) - self.fine_tune = fine_tune - self.inference = inference - - -class EndpointModelProperties(msrest.serialization.Model): - """Endpoint Model properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar deprecation: - :vartype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar format: Deployment model format. - :vartype format: str - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar lifecycle_status: Model lifecycle status. Possible values include: "GenerallyAvailable", - "Preview". - :vartype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar name: Deployment model name. - :vartype name: str - :ivar skus: The list of Model Sku. - :vartype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'capabilities': {'key': 'capabilities', 'type': '{str}'}, - 'deprecation': {'key': 'deprecation', 'type': 'EndpointModelDeprecationProperties'}, - 'finetune_capabilities': {'key': 'finetuneCapabilities', 'type': '{str}'}, - 'format': {'key': 'format', 'type': 'str'}, - 'is_default_version': {'key': 'isDefaultVersion', 'type': 'bool'}, - 'lifecycle_status': {'key': 'lifecycleStatus', 'type': 'str'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'skus': {'key': 'skus', 'type': '[EndpointModelSkuProperties]'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - capabilities: Optional[Dict[str, str]] = None, - deprecation: Optional["EndpointModelDeprecationProperties"] = None, - finetune_capabilities: Optional[Dict[str, str]] = None, - format: Optional[str] = None, - is_default_version: Optional[bool] = None, - lifecycle_status: Optional[Union[str, "ModelLifecycleStatus"]] = None, - max_capacity: Optional[int] = None, - name: Optional[str] = None, - skus: Optional[List["EndpointModelSkuProperties"]] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword capabilities: The capabilities. - :paramtype capabilities: dict[str, str] - :keyword deprecation: - :paramtype deprecation: - ~azure.mgmt.machinelearningservices.models.EndpointModelDeprecationProperties - :keyword finetune_capabilities: The capabilities for finetune models. - :paramtype finetune_capabilities: dict[str, str] - :keyword format: Deployment model format. - :paramtype format: str - :keyword is_default_version: If the model is default version. - :paramtype is_default_version: bool - :keyword lifecycle_status: Model lifecycle status. Possible values include: - "GenerallyAvailable", "Preview". - :paramtype lifecycle_status: str or - ~azure.mgmt.machinelearningservices.models.ModelLifecycleStatus - :keyword max_capacity: The max capacity. - :paramtype max_capacity: int - :keyword name: Deployment model name. - :paramtype name: str - :keyword skus: The list of Model Sku. - :paramtype skus: list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuProperties] - :keyword version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :paramtype version: str - """ - super(EndpointModelProperties, self).__init__(**kwargs) - self.capabilities = capabilities - self.deprecation = deprecation - self.finetune_capabilities = finetune_capabilities - self.format = format - self.is_default_version = is_default_version - self.lifecycle_status = lifecycle_status - self.max_capacity = max_capacity - self.name = name - self.skus = skus - self.system_data = None - self.version = version - - -class EndpointModels(msrest.serialization.Model): - """EndpointModels. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: List of models. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointModelProperties]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointModelProperties"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: List of models. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EndpointModelProperties] - """ - super(EndpointModels, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointModelSkuCapacityProperties(msrest.serialization.Model): - """EndpointModelSkuCapacityProperties. - - :ivar default: The default capacity. - :vartype default: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - } - - def __init__( - self, - *, - default: Optional[int] = None, - maximum: Optional[int] = None, - **kwargs - ): - """ - :keyword default: The default capacity. - :paramtype default: int - :keyword maximum: The maximum capacity. - :paramtype maximum: int - """ - super(EndpointModelSkuCapacityProperties, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - - -class EndpointModelSkuProperties(msrest.serialization.Model): - """EndpointModelSkuProperties. - - :ivar capacity: - :vartype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :ivar connection_ids: The list of ARM id for the connection support this SKU. - :vartype connection_ids: list[str] - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar name: The name of the model SKU. - :vartype name: str - :ivar rate_limits: - :vartype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'EndpointModelSkuCapacityProperties'}, - 'connection_ids': {'key': 'connectionIds', 'type': '[str]'}, - 'deprecation_date': {'key': 'deprecationDate', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'rate_limits': {'key': 'rateLimits', 'type': '[EndpointModelSkuRateLimitProperties]'}, - 'usage_name': {'key': 'usageName', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional["EndpointModelSkuCapacityProperties"] = None, - connection_ids: Optional[List[str]] = None, - deprecation_date: Optional[datetime.datetime] = None, - name: Optional[str] = None, - rate_limits: Optional[List["EndpointModelSkuRateLimitProperties"]] = None, - usage_name: Optional[str] = None, - **kwargs - ): - """ - :keyword capacity: - :paramtype capacity: - ~azure.mgmt.machinelearningservices.models.EndpointModelSkuCapacityProperties - :keyword connection_ids: The list of ARM id for the connection support this SKU. - :paramtype connection_ids: list[str] - :keyword deprecation_date: The datetime of deprecation of the model SKU. - :paramtype deprecation_date: ~datetime.datetime - :keyword name: The name of the model SKU. - :paramtype name: str - :keyword rate_limits: - :paramtype rate_limits: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitProperties] - :keyword usage_name: The usage name of the model SKU. - :paramtype usage_name: str - """ - super(EndpointModelSkuProperties, self).__init__(**kwargs) - self.capacity = capacity - self.connection_ids = connection_ids - self.deprecation_date = deprecation_date - self.name = name - self.rate_limits = rate_limits - self.usage_name = usage_name - - -class EndpointModelSkuRateLimitProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitProperties. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: The call rate limit for the model. - :vartype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - 'rules': {'key': 'rules', 'type': '[EndpointModelSkuRateLimitRuleProperties]'}, - } - - def __init__( - self, - *, - count: Optional[float] = None, - renewal_period: Optional[float] = None, - rules: Optional[List["EndpointModelSkuRateLimitRuleProperties"]] = None, - **kwargs - ): - """ - :keyword count: The count value of Call Rate Limit. - :paramtype count: float - :keyword renewal_period: The renewal period in seconds of Call Rate Limit. - :paramtype renewal_period: float - :keyword rules: The call rate limit for the model. - :paramtype rules: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRuleProperties] - """ - super(EndpointModelSkuRateLimitProperties, self).__init__(**kwargs) - self.count = count - self.renewal_period = renewal_period - self.rules = rules - - -class EndpointModelSkuRateLimitRulePatternProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRulePatternProperties. - - :ivar method: - :vartype method: str - :ivar path: - :vartype path: str - """ - - _attribute_map = { - 'method': {'key': 'method', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - method: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword method: - :paramtype method: str - :keyword path: - :paramtype path: str - """ - super(EndpointModelSkuRateLimitRulePatternProperties, self).__init__(**kwargs) - self.method = method - self.path = path - - -class EndpointModelSkuRateLimitRuleProperties(msrest.serialization.Model): - """EndpointModelSkuRateLimitRuleProperties. - - :ivar count: - :vartype count: float - :ivar dynamic_throttling_enabled: If the dynamic throttling is enabled. - :vartype dynamic_throttling_enabled: bool - :ivar key: - :vartype key: str - :ivar match_patterns: - :vartype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :ivar min_count: - :vartype min_count: float - :ivar renewal_period: - :vartype renewal_period: float - """ - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, - 'key': {'key': 'key', 'type': 'str'}, - 'match_patterns': {'key': 'matchPatterns', 'type': '[EndpointModelSkuRateLimitRulePatternProperties]'}, - 'min_count': {'key': 'minCount', 'type': 'float'}, - 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, - } - - def __init__( - self, - *, - count: Optional[float] = None, - dynamic_throttling_enabled: Optional[bool] = None, - key: Optional[str] = None, - match_patterns: Optional[List["EndpointModelSkuRateLimitRulePatternProperties"]] = None, - min_count: Optional[float] = None, - renewal_period: Optional[float] = None, - **kwargs - ): - """ - :keyword count: - :paramtype count: float - :keyword dynamic_throttling_enabled: If the dynamic throttling is enabled. - :paramtype dynamic_throttling_enabled: bool - :keyword key: - :paramtype key: str - :keyword match_patterns: - :paramtype match_patterns: - list[~azure.mgmt.machinelearningservices.models.EndpointModelSkuRateLimitRulePatternProperties] - :keyword min_count: - :paramtype min_count: float - :keyword renewal_period: - :paramtype renewal_period: float - """ - super(EndpointModelSkuRateLimitRuleProperties, self).__init__(**kwargs) - self.count = count - self.dynamic_throttling_enabled = dynamic_throttling_enabled - self.key = key - self.match_patterns = match_patterns - self.min_count = min_count - self.renewal_period = renewal_period - - -class EndpointResourcePropertiesBasicResource(Resource): - """EndpointResourcePropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EndpointResourceProperties'}, - } - - def __init__( - self, - *, - properties: "EndpointResourceProperties", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EndpointResourceProperties - """ - super(EndpointResourcePropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class EndpointResourcePropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """EndpointResourcePropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EndpointResourcePropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EndpointResourcePropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - """ - super(EndpointResourcePropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EndpointScheduleAction(ScheduleActionBase): - """EndpointScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition - details. - - - .. raw:: html - - . - :vartype endpoint_invocation_definition: any - """ - - _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, - } - - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): - """ - :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action - definition details. - - - .. raw:: html - - . - :paramtype endpoint_invocation_definition: any - """ - super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = endpoint_invocation_definition - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties - """ - super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentContainer entities. - - :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class EnvironmentVariable(msrest.serialization.Model): - """EnvironmentVariable. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the Environment Variable. Possible values are: local - For local variable. - Possible values include: "local". Default value: "local". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "EnvironmentVariableType"]] = "local", - value: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the Environment Variable. Possible values are: local - For local - variable. Possible values include: "local". Default value: "local". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentVariableType - :keyword value: Value of the Environment variable. - :paramtype value: str - """ - super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.value = value - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, - } - - def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties - """ - super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = properties - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar auto_rebuild: Defines if image needs to be rebuilt based on base image changes. Possible - values include: "Disabled", "OnBaseImageUpdate". - :vartype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service - - - .. raw:: html - - . Possible values include: "Curated", "UserCreated". - :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :vartype image: str - :ivar image_details: Environment image details. - :vartype image_details: ~azure.mgmt.machinelearningservices.models.ImageDetails - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :ivar os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'image_details': {'key': 'imageDetails', 'type': 'ImageDetails'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - auto_rebuild: Optional[Union[str, "AutoRebuildSetting"]] = None, - build: Optional["BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - image_details: Optional["ImageDetails"] = None, - inference_config: Optional["InferenceContainerProperties"] = None, - os_type: Optional[Union[str, "OperatingSystemType"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword auto_rebuild: Defines if image needs to be rebuilt based on base image changes. - Possible values include: "Disabled", "OnBaseImageUpdate". - :paramtype auto_rebuild: str or ~azure.mgmt.machinelearningservices.models.AutoRebuildSetting - :keyword build: Configuration settings for Docker build context. - :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext - :keyword conda_file: Standard configuration file used by Conda that lets you install any kind - of package, including Python, R, and C/C++ packages. - - - .. raw:: html - - . - :paramtype conda_file: str - :keyword image: Name of the image that will be used for the environment. - - - .. raw:: html - - . - :paramtype image: str - :keyword image_details: Environment image details. - :paramtype image_details: ~azure.mgmt.machinelearningservices.models.ImageDetails - :keyword inference_config: Defines configuration specific to inference. - :paramtype inference_config: - ~azure.mgmt.machinelearningservices.models.InferenceContainerProperties - :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType - :keyword stage: Stage in the environment lifecycle assigned to this environment. - :paramtype stage: str - """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.auto_rebuild = auto_rebuild - self.build = build - self.conda_file = conda_file - self.environment_type = None - self.image = image - self.image_details = image_details - self.inference_config = inference_config - self.os_type = os_type - self.provisioning_state = None - self.stage = stage - - -class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of EnvironmentVersion entities. - - :ivar next_link: The link to the next page of EnvironmentVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type EnvironmentVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["EnvironmentVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type EnvironmentVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "VMPriceOSType"], - vm_tier: Union[str, "VMTier"], - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = retail_price - self.os_type = os_type - self.vm_tier = vm_tier - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - *, - billing_currency: Union[str, "BillingCurrency"], - unit_of_measure: Union[str, "UnitOfMeasure"], - values: List["EstimatedVMPrice"], - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = billing_currency - self.unit_of_measure = unit_of_measure - self.values = values - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpointsPropertyBag]'}, - } - - def __init__( - self, - *, - value: Optional[List["FQDNEndpointsPropertyBag"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointsPropertyBag] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = value - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, - } - - def __init__( - self, - *, - properties: "FeatureProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties - """ - super(Feature, self).__init__(**kwargs) - self.properties = properties - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): - """FeatureAttributionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :vartype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'feature_importance_settings': {'required': True}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'feature_importance_settings': {'key': 'featureImportanceSettings', 'type': 'FeatureImportanceSettings'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - feature_importance_settings: "FeatureImportanceSettings", - metric_threshold: "FeatureAttributionMetricThreshold", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword feature_importance_settings: Required. [Required] The settings for computing feature - importance. - :paramtype feature_importance_settings: - ~azure.mgmt.machinelearningservices.models.FeatureImportanceSettings - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetricThreshold - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.feature_importance_settings = feature_importance_settings - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class FeatureAttributionMetricThreshold(msrest.serialization.Model): - """FeatureAttributionMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] The feature attribution metric to calculate. Possible values - include: "NormalizedDiscountedCumulativeGain". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - - _validation = { - 'metric': {'required': True}, - } - - _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - def __init__( - self, - *, - metric: Union[str, "FeatureAttributionMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible - values include: "NormalizedDiscountedCumulativeGain". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.FeatureAttributionMetric - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class FeatureImportanceSettings(msrest.serialization.Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'target_column': {'key': 'targetColumn', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "FeatureImportanceMode"]] = None, - target_column: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: The mode of operation for computing feature importance. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeatureImportanceMode - :keyword target_column: The name of the target column within the input data asset. - :paramtype target_column: str - """ - super(FeatureImportanceSettings, self).__init__(**kwargs) - self.mode = mode - self.target_column = target_column - - -class FeatureProperties(ResourceBase): - """DTO object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Possible values include: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - feature_name: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword data_type: Specifies type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - :keyword feature_name: Specifies name. - :paramtype feature_name: str - """ - super(FeatureProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.data_type = data_type - self.feature_name = feature_name - - -class FeatureResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Feature entities. - - :ivar next_link: The link to the next page of Feature objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type Feature. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Feature"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Feature objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Feature. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] - """ - super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties - """ - super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetContainerProperties(AssetContainer): - """DTO object representing feature set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturesetContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetContainer entities. - - :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetSpecification(msrest.serialization.Model): - """DTO object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword path: Specifies the spec path. - :paramtype path: str - """ - super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = path - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturesetVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties - """ - super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturesetVersionBackfillRequest(msrest.serialization.Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: A set of tags. Specifies the tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'data_availability_status': {'key': 'dataAvailabilityStatus', 'type': '[str]'}, - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - data_availability_status: Optional[List[Union[str, "DataAvailabilityStatus"]]] = None, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data_availability_status: Specified the data availability status that you want to - backfill. - :paramtype data_availability_status: list[str or - ~azure.mgmt.machinelearningservices.models.DataAvailabilityStatus] - :keyword description: Specifies description. - :paramtype description: str - :keyword display_name: Specifies description. - :paramtype display_name: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specify the jobId to retry the failed materialization. - :paramtype job_id: str - :keyword properties: Specifies the properties. - :paramtype properties: dict[str, str] - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword tags: A set of tags. Specifies the tags. - :paramtype tags: dict[str, str] - """ - super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.data_availability_status = data_availability_status - self.description = description - self.display_name = display_name - self.feature_window = feature_window - self.job_id = job_id - self.properties = properties - self.resource = resource - self.spark_configuration = spark_configuration - self.tags = tags - - -class FeaturesetVersionBackfillResponse(msrest.serialization.Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - _attribute_map = { - 'job_ids': {'key': 'jobIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - job_ids: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword job_ids: List of jobs submitted as part of the backfill request. - :paramtype job_ids: list[str] - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_ids = job_ids - - -class FeaturesetVersionProperties(AssetBase): - """DTO object representing feature set version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - entities: Optional[List[str]] = None, - materialization_settings: Optional["MaterializationSettings"] = None, - specification: Optional["FeaturesetSpecification"] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword entities: Specifies list of entities. - :paramtype entities: list[str] - :keyword materialization_settings: Specifies the materialization settings. - :paramtype materialization_settings: - ~azure.mgmt.machinelearningservices.models.MaterializationSettings - :keyword specification: Specifies the feature spec details. - :paramtype specification: ~azure.mgmt.machinelearningservices.models.FeaturesetSpecification - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturesetVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.entities = entities - self.materialization_settings = materialization_settings - self.provisioning_state = None - self.specification = specification - self.stage = stage - - -class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetVersion entities. - - :ivar next_link: The link to the next page of FeaturesetVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties - """ - super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """DTO object representing feature entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(FeaturestoreEntityContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityContainer entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, - } - - def __init__( - self, - *, - properties: "FeaturestoreEntityVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties - """ - super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = properties - - -class FeaturestoreEntityVersionProperties(AssetBase): - """DTO object representing feature entity version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Possible - values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - index_columns: Optional[List["IndexColumn"]] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword index_columns: Specifies index columns. - :paramtype index_columns: list[~azure.mgmt.machinelearningservices.models.IndexColumn] - :keyword stage: Specifies the asset stage. - :paramtype stage: str - """ - super(FeaturestoreEntityVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.index_columns = index_columns - self.provisioning_state = None - self.stage = stage - - -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturestoreEntityVersion entities. - - :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturestoreEntityVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturestoreEntityVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturestoreEntityVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeatureStoreSettings(msrest.serialization.Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_runtime: Optional["ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - **kwargs - ): - """ - :keyword compute_runtime: - :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto - :keyword offline_store_connection_name: - :paramtype offline_store_connection_name: str - :keyword online_store_connection_name: - :paramtype online_store_connection_name: str - """ - super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = compute_runtime - self.offline_store_connection_name = offline_store_connection_name - self.online_store_connection_name = online_store_connection_name - - -class FeatureSubset(MonitoringFeatureFilterBase): - """FeatureSubset. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar features: Required. [Required] The list of features to include. - :vartype features: list[str] - """ - - _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, - } - - def __init__( - self, - *, - features: List[str], - **kwargs - ): - """ - :keyword features: Required. [Required] The list of features to include. - :paramtype features: list[str] - """ - super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = features - - -class FeatureWindow(msrest.serialization.Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - feature_window_end: Optional[datetime.datetime] = None, - feature_window_start: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword feature_window_end: Specifies the feature window end time. - :paramtype feature_window_end: ~datetime.datetime - :keyword feature_window_start: Specifies the feature window start time. - :paramtype feature_window_start: ~datetime.datetime - """ - super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = feature_window_end - self.feature_window_start = feature_window_start - - -class FeaturizationSettings(msrest.serialization.Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = dataset_language - - -class FinetuningDetails(msrest.serialization.Model): - """FinetuningDetails. - - All required parameters must be populated in order to send to Azure. - - :ivar hyper_parameters: Finetuning Hyperparameters. - :vartype hyper_parameters: dict[str, str] - :ivar student_model: Required. [Required] Student model for fine tuning. - :vartype student_model: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'student_model': {'required': True}, - } - - _attribute_map = { - 'hyper_parameters': {'key': 'hyperParameters', 'type': '{str}'}, - 'student_model': {'key': 'studentModel', 'type': 'JobInput'}, - } - - def __init__( - self, - *, - student_model: "JobInput", - hyper_parameters: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword hyper_parameters: Finetuning Hyperparameters. - :paramtype hyper_parameters: dict[str, str] - :keyword student_model: Required. [Required] Student model for fine tuning. - :paramtype student_model: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(FinetuningDetails, self).__init__(**kwargs) - self.hyper_parameters = hyper_parameters - self.student_model = student_model - - -class FineTuningJob(JobBaseProperties): - """FineTuning Job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar fine_tuning_details: Required. [Required]. - :vartype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :ivar outputs: Required. [Required]. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Instance types and other resources for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'fine_tuning_details': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'fine_tuning_details': {'key': 'fineTuningDetails', 'type': 'FineTuningVertical'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResources'}, - } - - def __init__( - self, - *, - fine_tuning_details: "FineTuningVertical", - outputs: Dict[str, "JobOutput"], - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["JobResources"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword fine_tuning_details: Required. [Required]. - :paramtype fine_tuning_details: ~azure.mgmt.machinelearningservices.models.FineTuningVertical - :keyword outputs: Required. [Required]. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Instance types and other resources for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResources - """ - super(FineTuningJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, parent_job_name=parent_job_name, services=services, **kwargs) - self.job_type = 'FineTuning' # type: str - self.fine_tuning_details = fine_tuning_details - self.outputs = outputs - self.queue_settings = queue_settings - self.resources = resources - - -class MonitoringInputDataBase(msrest.serialization.Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FixedInputData, RollingInputData, StaticInputData. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - _subtype_map = { - 'input_data_type': {'Fixed': 'FixedInputData', 'Rolling': 'RollingInputData', 'Static': 'StaticInputData'} - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(MonitoringInputDataBase, self).__init__(**kwargs) - self.columns = columns - self.data_context = data_context - self.input_data_type = None # type: Optional[str] - self.job_input_type = job_input_type - self.uri = uri - - -class FixedInputData(MonitoringInputDataBase): - """Fixed input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - """ - super(FixedInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Fixed' # type: str - - -class FlavorData(msrest.serialization.Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, - } - - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword data: Model flavor-specific data. - :paramtype data: dict[str, str] - """ - super(FlavorData, self).__init__(**kwargs) - self.data = data - - -class Forecasting(AutoMLVertical, TableVertical): - """Forecasting task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :ivar primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, - training_settings: Optional["ForecastingTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword forecasting_settings: Forecasting task specific inputs. - :paramtype forecasting_settings: ~azure.mgmt.machinelearningservices.models.ForecastingSettings - :keyword primary_metric: Primary metric for forecasting task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings - """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ForecastingSettings(msrest.serialization.Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :vartype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :vartype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :vartype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :vartype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - - _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "FeatureLags"]] = None, - forecast_horizon: Optional["ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, - target_lags: Optional["TargetLags"] = None, - target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[List[str]] = None, - use_stl: Optional[Union[str, "UseStl"]] = None, - **kwargs - ): - """ - :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :paramtype country_or_region_for_holidays: str - :keyword cv_step_size: Number of periods between the origin time of one CV fold and the next - fold. For - example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be - three days apart. - :paramtype cv_step_size: int - :keyword feature_lags: Flag for generating lags for the numeric features with 'auto' or null. - Possible values include: "None", "Auto". - :paramtype feature_lags: str or ~azure.mgmt.machinelearningservices.models.FeatureLags - :keyword forecast_horizon: The desired maximum forecast horizon in units of time-series - frequency. - :paramtype forecast_horizon: ~azure.mgmt.machinelearningservices.models.ForecastHorizon - :keyword frequency: When forecasting, this parameter represents the period with which the - forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset - frequency by default. - :paramtype frequency: str - :keyword seasonality: Set time series seasonality as an integer multiple of the series - frequency. - If seasonality is set to 'auto', it will be inferred. - :paramtype seasonality: ~azure.mgmt.machinelearningservices.models.Seasonality - :keyword short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Possible values include: "None", "Auto", "Pad", "Drop". - :paramtype short_series_handling_config: str or - ~azure.mgmt.machinelearningservices.models.ShortSeriesHandlingConfiguration - :keyword target_aggregate_function: The function to be used to aggregate the time series target - column to conform to a user specified frequency. - If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the - error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". - Possible values include: "None", "Sum", "Max", "Min", "Mean". - :paramtype target_aggregate_function: str or - ~azure.mgmt.machinelearningservices.models.TargetAggregationFunction - :keyword target_lags: The number of past periods to lag from the target column. - :paramtype target_lags: ~azure.mgmt.machinelearningservices.models.TargetLags - :keyword target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :paramtype target_rolling_window_size: - ~azure.mgmt.machinelearningservices.models.TargetRollingWindowSize - :keyword time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :paramtype time_column_name: str - :keyword time_series_id_column_names: The names of columns used to group a timeseries. It can - be used to create multiple series. - If grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting. - :paramtype time_series_id_column_names: list[str] - :keyword use_stl: Configure STL Decomposition of the time-series target column. Possible values - include: "None", "Season", "SeasonTrend". - :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl - """ - super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = country_or_region_for_holidays - self.cv_step_size = cv_step_size - self.feature_lags = feature_lags - self.forecast_horizon = forecast_horizon - self.frequency = frequency - self.seasonality = seasonality - self.short_series_handling_config = short_series_handling_config - self.target_aggregate_function = target_aggregate_function - self.target_lags = target_lags - self.target_rolling_window_size = target_rolling_window_size - self.time_column_name = time_column_name - self.time_series_id_column_names = time_series_id_column_names - self.use_stl = use_stl - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for forecasting task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - :keyword blocked_training_algorithms: Blocked models for forecasting task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.ForecastingModels] - """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[List["FQDNEndpointDetail"]] = None, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = port - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[List["FQDNEndpoint"]] = None, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class FQDNEndpointsPropertyBag(msrest.serialization.Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpoints'}, - } - - def __init__( - self, - *, - properties: Optional["FQDNEndpoints"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpoints - """ - super(FQDNEndpointsPropertyBag, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRule(msrest.serialization.Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - """ - super(OutboundRule, self).__init__(**kwargs) - self.category = category - self.parent_rule_names = None - self.status = status - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'FQDN' # type: str - self.destination = destination - - -class GetBlobReferenceForConsumptionDto(msrest.serialization.Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredential'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["DataReferenceCredential"] = None, - storage_account_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword blob_uri: Blob uri, example: https://blob.windows.core.net/Container/Path. - :paramtype blob_uri: str - :keyword credential: Credential info to access storage account. - :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredential - :keyword storage_account_arm_id: The ARM id of the storage account. - :paramtype storage_account_arm_id: str - """ - super(GetBlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = blob_uri - self.credential = credential - self.storage_account_arm_id = storage_account_arm_id - - -class GetBlobReferenceSASRequestDto(msrest.serialization.Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - blob_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: Id of the asset to be accessed. - :paramtype asset_id: str - :keyword blob_uri: Blob uri of the asset to be accessed. - :paramtype blob_uri: str - """ - super(GetBlobReferenceSASRequestDto, self).__init__(**kwargs) - self.asset_id = asset_id - self.blob_uri = blob_uri - - -class GetBlobReferenceSASResponseDto(msrest.serialization.Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'GetBlobReferenceForConsumptionDto'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["GetBlobReferenceForConsumptionDto"] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Blob reference for consumption details. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.GetBlobReferenceForConsumptionDto - """ - super(GetBlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - - -class GridSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str - - -class GroupEnvironmentConfiguration(msrest.serialization.Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: - list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - - _attribute_map = { - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '[StringKeyValuePair]'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'startup_probe': {'key': 'startupProbe', 'type': 'ProbeSettings'}, - } - - def __init__( - self, - *, - environment_id: Optional[str] = None, - environment_variables: Optional[List["StringKeyValuePair"]] = None, - liveness_probe: Optional["ProbeSettings"] = None, - readiness_probe: Optional["ProbeSettings"] = None, - startup_probe: Optional["ProbeSettings"] = None, - **kwargs - ): - """ - :keyword environment_id: ARM resource ID of the environment specification for the inference - pool. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the inference pool. - :paramtype environment_variables: - list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :paramtype startup_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - """ - super(GroupEnvironmentConfiguration, self).__init__(**kwargs) - self.environment_id = environment_id - self.environment_variables = environment_variables - self.liveness_probe = liveness_probe - self.readiness_probe = readiness_probe - self.startup_probe = startup_probe - - -class GroupModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword model_id: The URI path to the model. - :paramtype model_id: str - """ - super(GroupModelConfiguration, self).__init__(**kwargs) - self.model_id = model_id - - -class GroupStatus(msrest.serialization.Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - _attribute_map = { - 'actual_capacity_info': {'key': 'actualCapacityInfo', 'type': 'ActualCapacityInfo'}, - 'endpoint_count': {'key': 'endpointCount', 'type': 'int'}, - 'requested_capacity': {'key': 'requestedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - actual_capacity_info: Optional["ActualCapacityInfo"] = None, - endpoint_count: Optional[int] = 0, - requested_capacity: Optional[int] = 0, - **kwargs - ): - """ - :keyword actual_capacity_info: Gets or sets the actual capacity info for the group. - :paramtype actual_capacity_info: ~azure.mgmt.machinelearningservices.models.ActualCapacityInfo - :keyword endpoint_count: Gets or sets the actual number of endpoints in the group. - :paramtype endpoint_count: int - :keyword requested_capacity: Gets or sets the request number of instances for the group. - :paramtype requested_capacity: int - """ - super(GroupStatus, self).__init__(**kwargs) - self.actual_capacity_info = actual_capacity_info - self.endpoint_count = endpoint_count - self.requested_capacity = requested_capacity - - -class HDInsightSchema(msrest.serialization.Model): - """HDInsightSchema. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsightSchema, self).__init__(**kwargs) - self.properties = properties - - -class HDInsight(Compute, HDInsightSchema): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'HDInsight' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - - -class IdAssetReference(AssetReferenceBase): - """Reference to an asset via its ARM resource ID. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar asset_id: Required. [Required] ARM resource ID of the asset. - :vartype asset_id: str - """ - - _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_id: str, - **kwargs - ): - """ - :keyword asset_id: Required. [Required] ARM resource ID of the asset. - :paramtype asset_id: str - """ - super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = asset_id - - -class IdentityForCmk(msrest.serialization.Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key - from keyVault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity - - -class IdleShutdownSetting(msrest.serialization.Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - } - - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs - ): - """ - :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, - maximum is 3 days. - :paramtype idle_time_before_shutdown: str - """ - super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = idle_time_before_shutdown - - -class Image(msrest.serialization.Model): - """Image. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar type: Type of the image. Possible values are: docker - For docker images. azureml - For - AzureML Environment images (custom and curated). Possible values include: "docker", "azureml". - Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: Optional[str] = None, - version: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword type: Type of the image. Possible values are: docker - For docker images. azureml - - For AzureML Environment images (custom and curated). Possible values include: "docker", - "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL if type is docker. Environment name if type is azureml. - :paramtype reference: str - :keyword version: Version of image being used. If latest then skip this field. - :paramtype version: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - self.version = version - - -class ImageVertical(msrest.serialization.Model): - """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - """ - super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - - -class ImageClassificationBase(ImageVertical): - """ImageClassificationBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageClassification(AutoMLVertical, ImageClassificationBase): - """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): - """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageDetails(msrest.serialization.Model): - """ImageDetails. - - :ivar exists: Indicates if image exists. - :vartype exists: bool - :ivar image: Container image details. - :vartype image: ~azure.mgmt.machinelearningservices.models.ImageInfo - :ivar vulnerability_findings: Vulnerability findings details. - :vartype vulnerability_findings: - ~azure.mgmt.machinelearningservices.models.VulnerabilityFindings - """ - - _attribute_map = { - 'exists': {'key': 'exists', 'type': 'bool'}, - 'image': {'key': 'image', 'type': 'ImageInfo'}, - 'vulnerability_findings': {'key': 'vulnerabilityFindings', 'type': 'VulnerabilityFindings'}, - } - - def __init__( - self, - *, - exists: Optional[bool] = None, - image: Optional["ImageInfo"] = None, - vulnerability_findings: Optional["VulnerabilityFindings"] = None, - **kwargs - ): - """ - :keyword exists: Indicates if image exists. - :paramtype exists: bool - :keyword image: Container image details. - :paramtype image: ~azure.mgmt.machinelearningservices.models.ImageInfo - :keyword vulnerability_findings: Vulnerability findings details. - :paramtype vulnerability_findings: - ~azure.mgmt.machinelearningservices.models.VulnerabilityFindings - """ - super(ImageDetails, self).__init__(**kwargs) - self.exists = exists - self.image = image - self.vulnerability_findings = vulnerability_findings - - -class ImageInfo(msrest.serialization.Model): - """ImageInfo. - - :ivar digest: Image digest. - :vartype digest: str - :ivar hostname: Container registry host name. - :vartype hostname: str - :ivar repository: Repository name. - :vartype repository: str - :ivar tag: Image tag. - :vartype tag: str - """ - - _attribute_map = { - 'digest': {'key': 'digest', 'type': 'str'}, - 'hostname': {'key': 'hostname', 'type': 'str'}, - 'repository': {'key': 'repository', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - } - - def __init__( - self, - *, - digest: Optional[str] = None, - hostname: Optional[str] = None, - repository: Optional[str] = None, - tag: Optional[str] = None, - **kwargs - ): - """ - :keyword digest: Image digest. - :paramtype digest: str - :keyword hostname: Container registry host name. - :paramtype hostname: str - :keyword repository: Repository name. - :paramtype repository: str - :keyword tag: Image tag. - :paramtype tag: str - """ - super(ImageInfo, self).__init__(**kwargs) - self.digest = digest - self.hostname = hostname - self.repository = repository - self.tag = tag - - -class ImageObjectDetectionBase(ImageVertical): - """ImageObjectDetectionBase. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - - _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) - self.model_settings = model_settings - self.search_space = search_space - - -class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics - """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageLimitSettings(msrest.serialization.Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Maximum number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class ImageMetadata(msrest.serialization.Model): - """Returns metadata about the operating system image for this compute instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: ~azure.mgmt.machinelearningservices.models.OsPatchingStatus - """ - - _validation = { - 'os_patching_status': {'readonly': True}, - } - - _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, - 'os_patching_status': {'key': 'osPatchingStatus', 'type': 'OsPatchingStatus'}, - } - - def __init__( - self, - *, - current_image_version: Optional[str] = None, - latest_image_version: Optional[str] = None, - is_latest_os_image_version: Optional[bool] = None, - **kwargs - ): - """ - :keyword current_image_version: Specifies the current operating system image version this - compute instance is running on. - :paramtype current_image_version: str - :keyword latest_image_version: Specifies the latest available operating system image version. - :paramtype latest_image_version: str - :keyword is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :paramtype is_latest_os_image_version: bool - """ - super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = current_image_version - self.latest_image_version = latest_image_version - self.is_latest_os_image_version = is_latest_os_image_version - self.os_patching_status = None - - -class ImageModelDistributionSettings(msrest.serialization.Model): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - """ - super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: str - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: str - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: str - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: str - """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - **kwargs - ): - """ - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: str - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: str - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: str - :keyword distributed: Whether to use distributer training. - :paramtype distributed: str - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: str - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: str - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: str - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: str - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: str - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: str - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: str - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :paramtype learning_rate_scheduler: str - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: str - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: str - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: str - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: str - :keyword optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :paramtype optimizer: str - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: str - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: str - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: str - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: str - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: str - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: str - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: str - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: str - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: str - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: str - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: str - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: str - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: str - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype model_size: str - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: str - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :paramtype nms_iou_threshold: str - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: str - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :paramtype tile_predictions_nms_threshold: str - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: str - :keyword validation_metric_type: Metric computation method to use for validation metrics. Must - be 'none', 'coco', 'voc', or 'coco_voc'. - :paramtype validation_metric_type: str - """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageModelSettings(msrest.serialization.Model): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - """ - super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = advanced_settings - self.ams_gradient = ams_gradient - self.augmentations = augmentations - self.beta1 = beta1 - self.beta2 = beta2 - self.checkpoint_frequency = checkpoint_frequency - self.checkpoint_model = checkpoint_model - self.checkpoint_run_id = checkpoint_run_id - self.distributed = distributed - self.early_stopping = early_stopping - self.early_stopping_delay = early_stopping_delay - self.early_stopping_patience = early_stopping_patience - self.enable_onnx_normalization = enable_onnx_normalization - self.evaluation_frequency = evaluation_frequency - self.gradient_accumulation_step = gradient_accumulation_step - self.layers_to_freeze = layers_to_freeze - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.momentum = momentum - self.nesterov = nesterov - self.number_of_epochs = number_of_epochs - self.number_of_workers = number_of_workers - self.optimizer = optimizer - self.random_seed = random_seed - self.step_lr_gamma = step_lr_gamma - self.step_lr_step_size = step_lr_step_size - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_cosine_lr_cycles = warmup_cosine_lr_cycles - self.warmup_cosine_lr_warmup_epochs = warmup_cosine_lr_warmup_epochs - self.weight_decay = weight_decay - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword training_crop_size: Image crop size that is input to the neural network for the - training dataset. Must be a positive integer. - :paramtype training_crop_size: int - :keyword validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :paramtype validation_crop_size: int - :keyword validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :paramtype validation_resize_size: int - :keyword weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :paramtype weighted_loss: int - """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.training_crop_size = training_crop_size - self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, - **kwargs - ): - """ - :keyword advanced_settings: Settings for advanced scenarios. - :paramtype advanced_settings: str - :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :paramtype ams_gradient: bool - :keyword augmentations: Settings for using Augmentations. - :paramtype augmentations: str - :keyword beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta1: float - :keyword beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the - range [0, 1]. - :paramtype beta2: float - :keyword checkpoint_frequency: Frequency to store model checkpoints. Must be a positive - integer. - :paramtype checkpoint_frequency: int - :keyword checkpoint_model: The pretrained checkpoint model for incremental training. - :paramtype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :keyword checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :paramtype checkpoint_run_id: str - :keyword distributed: Whether to use distributed training. - :paramtype distributed: bool - :keyword early_stopping: Enable early stopping logic during training. - :paramtype early_stopping: bool - :keyword early_stopping_delay: Minimum number of epochs or validation evaluations to wait - before primary metric improvement - is tracked for early stopping. Must be a positive integer. - :paramtype early_stopping_delay: int - :keyword early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :paramtype early_stopping_patience: int - :keyword enable_onnx_normalization: Enable normalization when exporting ONNX model. - :paramtype enable_onnx_normalization: bool - :keyword evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. - Must be a positive integer. - :paramtype evaluation_frequency: int - :keyword gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :paramtype gradient_accumulation_step: int - :keyword layers_to_freeze: Number of layers to freeze for the model. Must be a positive - integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype layers_to_freeze: int - :keyword learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :keyword model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - :paramtype model_name: str - :keyword momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, - 1]. - :paramtype momentum: float - :keyword nesterov: Enable nesterov when optimizer is 'sgd'. - :paramtype nesterov: bool - :keyword number_of_epochs: Number of training epochs. Must be a positive integer. - :paramtype number_of_epochs: int - :keyword number_of_workers: Number of data loader workers. Must be a non-negative integer. - :paramtype number_of_workers: int - :keyword optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :paramtype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :keyword random_seed: Random seed to be used when using deterministic training. - :paramtype random_seed: int - :keyword step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float - in the range [0, 1]. - :paramtype step_lr_gamma: float - :keyword step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be - a positive integer. - :paramtype step_lr_step_size: int - :keyword training_batch_size: Training batch size. Must be a positive integer. - :paramtype training_batch_size: int - :keyword validation_batch_size: Validation batch size. Must be a positive integer. - :paramtype validation_batch_size: int - :keyword warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :paramtype warmup_cosine_lr_cycles: float - :keyword warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :paramtype warmup_cosine_lr_warmup_epochs: int - :keyword weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must - be a float in the range[0, 1]. - :paramtype weight_decay: float - :keyword box_detections_per_image: Maximum number of detections per image, for all classes. - Must be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype box_detections_per_image: int - :keyword box_score_threshold: During inference, only return proposals with a classification - score greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :paramtype box_score_threshold: float - :keyword image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype image_size: int - :keyword max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype max_size: int - :keyword min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype min_size: int - :keyword model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :paramtype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :keyword multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :paramtype multi_scale: bool - :keyword nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - a float in the range [0, 1]. - :paramtype nms_iou_threshold: float - :keyword tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must - not be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_grid_size: str - :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) - self.box_detections_per_image = box_detections_per_image - self.box_score_threshold = box_score_threshold - self.image_size = image_size - self.max_size = max_size - self.min_size = min_size - self.model_size = model_size - self.multi_scale = multi_scale - self.nms_iou_threshold = nms_iou_threshold - self.tile_grid_size = tile_grid_size - self.tile_overlap_ratio = tile_overlap_ratio - self.tile_predictions_nms_threshold = tile_predictions_nms_threshold - self.validation_iou_threshold = validation_iou_threshold - self.validation_metric_type = validation_metric_type - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - - _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - limit_settings: "ImageLimitSettings", - training_data: "MLTableJobInput", - sweep_settings: Optional["ImageSweepSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :keyword sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword model_settings: Settings used for training the model. - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics - """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) - self.limit_settings = limit_settings - self.sweep_settings = sweep_settings - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.model_settings = model_settings - self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class ImageSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter sweeping related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of the hyperparameter sampling algorithms. - Possible values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - - _validation = { - 'sampling_algorithm': {'required': True}, - } - - _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, - } - - def __init__( - self, - *, - sampling_algorithm: Union[str, "SamplingAlgorithmType"], - early_termination: Optional["EarlyTerminationPolicy"] = None, - **kwargs - ): - """ - :keyword early_termination: Type of early termination policy. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of the hyperparameter sampling - algorithms. Possible values include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -class IndexColumn(msrest.serialization.Model): - """DTO object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Possible values include: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", "Boolean". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - - _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - } - - def __init__( - self, - *, - column_name: Optional[str] = None, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - **kwargs - ): - """ - :keyword column_name: Specifies the column name. - :paramtype column_name: str - :keyword data_type: Specifies the data type. Possible values include: "String", "Integer", - "Long", "Float", "Double", "Binary", "Datetime", "Boolean". - :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType - """ - super(IndexColumn, self).__init__(**kwargs) - self.column_name = column_name - self.data_type = data_type - - -class InferenceContainerProperties(msrest.serialization.Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - - _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword liveness_route: The route to check the liveness of the inference server container. - :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword readiness_route: The route to check the readiness of the inference server container. - :paramtype readiness_route: ~azure.mgmt.machinelearningservices.models.Route - :keyword scoring_route: The port to send the scoring requests to, within the inference server - container. - :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route - """ - super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class PropertiesBase(msrest.serialization.Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[List["StringKeyValuePair"]] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - """ - super(PropertiesBase, self).__init__(**kwargs) - self.description = description - self.properties = properties - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_name: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :vartype group_name: str - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar request_configuration: RequestConfiguration for endpoint. - :vartype request_configuration: ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_uri': {'readonly': True}, - 'group_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'group_name': {'key': 'groupName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'request_configuration': {'key': 'requestConfiguration', 'type': 'RequestConfiguration'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "AuthMode"], - group_name: str, - description: Optional[str] = None, - properties: Optional[List["StringKeyValuePair"]] = None, - request_configuration: Optional["RequestConfiguration"] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword auth_mode: Required. [Required] Authentication mode for the endpoint. Possible values - include: "AAD". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.AuthMode - :keyword group_name: Required. [Required] Group within the same pool with which this endpoint - needs to be associated with. - :paramtype group_name: str - :keyword request_configuration: RequestConfiguration for endpoint. - :paramtype request_configuration: - ~azure.mgmt.machinelearningservices.models.RequestConfiguration - """ - super(InferenceEndpointProperties, self).__init__(description=description, properties=properties, **kwargs) - self.auth_mode = auth_mode - self.endpoint_uri = None - self.group_name = group_name - self.provisioning_state = None - self.request_configuration = request_configuration - - -class InferenceEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceEndpoint entities. - - :ivar next_link: The link to the next page of InferenceEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - """ - super(InferenceEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferenceGroup(TrackedResource): - """InferenceGroup. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferenceGroupProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferenceGroupProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferenceGroupProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferenceGroup, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar environment_configuration: Gets or sets environment configuration for the inference - group. Used if PoolType=ScaleUnit. - :vartype environment_configuration: - ~azure.mgmt.machinelearningservices.models.GroupEnvironmentConfiguration - :ivar model_configuration: Gets or sets model configuration for the inference group. Used if - PoolType=ScaleUnit. - :vartype model_configuration: - ~azure.mgmt.machinelearningservices.models.GroupModelConfiguration - :ivar node_sku_type: Gets or sets compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the inference group. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar scale_unit_size: Gets or sets Scale Unit size. - :vartype scale_unit_size: int - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - 'environment_configuration': {'key': 'environmentConfiguration', 'type': 'GroupEnvironmentConfiguration'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'GroupModelConfiguration'}, - 'node_sku_type': {'key': 'nodeSkuType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'scale_unit_size': {'key': 'scaleUnitSize', 'type': 'int'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[List["StringKeyValuePair"]] = None, - environment_configuration: Optional["GroupEnvironmentConfiguration"] = None, - model_configuration: Optional["GroupModelConfiguration"] = None, - node_sku_type: Optional[str] = None, - scale_unit_size: Optional[int] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword environment_configuration: Gets or sets environment configuration for the inference - group. Used if PoolType=ScaleUnit. - :paramtype environment_configuration: - ~azure.mgmt.machinelearningservices.models.GroupEnvironmentConfiguration - :keyword model_configuration: Gets or sets model configuration for the inference group. Used if - PoolType=ScaleUnit. - :paramtype model_configuration: - ~azure.mgmt.machinelearningservices.models.GroupModelConfiguration - :keyword node_sku_type: Gets or sets compute instance type. - :paramtype node_sku_type: str - :keyword scale_unit_size: Gets or sets Scale Unit size. - :paramtype scale_unit_size: int - """ - super(InferenceGroupProperties, self).__init__(description=description, properties=properties, **kwargs) - self.environment_configuration = environment_configuration - self.model_configuration = model_configuration - self.node_sku_type = node_sku_type - self.provisioning_state = None - self.scale_unit_size = scale_unit_size - - -class InferenceGroupTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferenceGroup entities. - - :ivar next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferenceGroup. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferenceGroup]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferenceGroup"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferenceGroup objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferenceGroup. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferenceGroup] - """ - super(InferenceGroupTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InferencePool(TrackedResource): - """InferencePool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'InferencePoolProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "InferencePoolProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.InferencePoolProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(InferencePool, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :ivar provisioning_state: Provisioning state for the pool. Possible values include: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PoolProvisioningState - :ivar scale_unit_configuration: Gets or sets ScaleUnitConfiguration for the inference pool. - Used if PoolType=ScaleUnit. - :vartype scale_unit_configuration: - ~azure.mgmt.machinelearningservices.models.ScaleUnitConfiguration - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[StringKeyValuePair]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'scale_unit_configuration': {'key': 'scaleUnitConfiguration', 'type': 'ScaleUnitConfiguration'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[List["StringKeyValuePair"]] = None, - scale_unit_configuration: Optional["ScaleUnitConfiguration"] = None, - **kwargs - ): - """ - :keyword description: Description of the resource. - :paramtype description: str - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: list[~azure.mgmt.machinelearningservices.models.StringKeyValuePair] - :keyword scale_unit_configuration: Gets or sets ScaleUnitConfiguration for the inference pool. - Used if PoolType=ScaleUnit. - :paramtype scale_unit_configuration: - ~azure.mgmt.machinelearningservices.models.ScaleUnitConfiguration - """ - super(InferencePoolProperties, self).__init__(description=description, properties=properties, **kwargs) - self.provisioning_state = None - self.scale_unit_configuration = scale_unit_configuration - - -class InferencePoolTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of InferencePool entities. - - :ivar next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type InferencePool. - :vartype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[InferencePool]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["InferencePool"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of InferencePool objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type InferencePool. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.InferencePool] - """ - super(InferencePoolTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - *, - node_selector: Optional[Dict[str, str]] = None, - resources: Optional["InstanceTypeSchemaResources"] = None, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = node_selector - self.resources = resources - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - *, - requests: Optional[Dict[str, str]] = None, - limits: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = requests - self.limits = limits - - -class IPRule(msrest.serialization.Model): - """Contains an IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' or 'Deny'. - - :ivar value: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) - or '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' or - 'Deny'. - :vartype value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP - address) or '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' - or 'Deny'. - :paramtype value: str - """ - super(IPRule, self).__init__(**kwargs) - self.value = value - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobBase, self).__init__(**kwargs) - self.properties = properties - - -class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of JobBase entities. - - :ivar next_link: The link to the next page of JobBase objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type JobBase. - :vartype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["JobBase"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of JobBase objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type JobBase. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] - """ - super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar docker_args_list: Extra arguments to pass to the Docker run command, as a collection. - This would override any parameters that have already been set by the system, or in this - section. This parameter is only supported for Azure ML compute types. - :vartype docker_args_list: list[str] - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, - } - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'docker_args_list': {'key': 'dockerArgsList', 'type': '[str]'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - properties: Optional[Dict[str, Any]] = None, - docker_args: Optional[str] = None, - docker_args_list: Optional[List[str]] = None, - shm_size: Optional[str] = "2g", - **kwargs - ): - """ - :keyword instance_count: Optional number of instances or nodes used by the compute target. - :paramtype instance_count: int - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - :keyword docker_args: Extra arguments to pass to the Docker run command. This would override - any parameters that have already been set by the system, or in this section. This parameter is - only supported for Azure ML compute types. - :paramtype docker_args: str - :keyword docker_args_list: Extra arguments to pass to the Docker run command, as a collection. - This would override any parameters that have already been set by the system, or in this - section. This parameter is only supported for Azure ML compute types. - :paramtype docker_args_list: list[str] - :keyword shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :paramtype shm_size: str - """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) - self.docker_args = docker_args - self.docker_args_list = docker_args_list - self.shm_size = shm_size - - -class JobResources(msrest.serialization.Model): - """JobResources. - - :ivar instance_types: List of instance types to choose from. - :vartype instance_types: list[str] - """ - - _attribute_map = { - 'instance_types': {'key': 'instanceTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - instance_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword instance_types: List of instance types to choose from. - :paramtype instance_types: list[str] - """ - super(JobResources, self).__init__(**kwargs) - self.instance_types = instance_types - - -class JobScheduleAction(ScheduleActionBase): - """JobScheduleAction. - - All required parameters must be populated in order to send to Azure. - - :ivar action_type: Required. [Required] Specifies the action type of the schedule.Constant - filled by server. Possible values include: "CreateJob", "InvokeBatchEndpoint", "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar job_definition: Required. [Required] Defines Schedule action definition details. - :vartype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - - _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, - } - - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): - """ - :keyword job_definition: Required. [Required] Defines Schedule action definition details. - :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties - """ - super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = job_definition - - -class JobService(msrest.serialization.Model): - """Job endpoint definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :vartype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - nodes: Optional["Nodes"] = None, - port: Optional[int] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword endpoint: Url for endpoint. - :paramtype endpoint: str - :keyword job_service_type: Endpoint type. - :paramtype job_service_type: str - :keyword nodes: Nodes that user would like to start the service on. - If Nodes is not set or set to null, the service will only be started on leader node. - :paramtype nodes: ~azure.mgmt.machinelearningservices.models.Nodes - :keyword port: Port for endpoint. - :paramtype port: int - :keyword properties: Additional properties to set on the endpoint. - :paramtype properties: dict[str, str] - """ - super(JobService, self).__init__(**kwargs) - self.endpoint = endpoint - self.error_message = None - self.job_service_type = job_service_type - self.nodes = nodes - self.port = port - self.properties = properties - self.status = None - - -class JupyterKernelConfig(msrest.serialization.Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - _attribute_map = { - 'argv': {'key': 'argv', 'type': '[str]'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - argv: Optional[List[str]] = None, - display_name: Optional[str] = None, - language: Optional[str] = None, - **kwargs - ): - """ - :keyword argv: Argument to the the runtime. - :paramtype argv: list[str] - :keyword display_name: Display name of the kernel. - :paramtype display_name: str - :keyword language: Language of the kernel [Example value: python]. - :paramtype language: str - """ - super(JupyterKernelConfig, self).__init__(**kwargs) - self.argv = argv - self.display_name = display_name - self.language = language - - -class KeyVaultProperties(msrest.serialization.Model): - """Customer Key vault properties. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: Required. KeyVault key identifier to encrypt the data. - :vartype key_identifier: str - :ivar key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :vartype key_vault_arm_id: str - """ - - _validation = { - 'key_identifier': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'key_vault_arm_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - key_vault_arm_id: str, - identity_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword identity_client_id: Currently, we support only SystemAssigned MSI. - We need this when we support UserAssignedIdentities. - :paramtype identity_client_id: str - :keyword key_identifier: Required. KeyVault key identifier to encrypt the data. - :paramtype key_identifier: str - :keyword key_vault_arm_id: Required. KeyVault Arm Id that contains the data encryption key. - :paramtype key_vault_arm_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.identity_client_id = identity_client_id - self.key_identifier = key_identifier - self.key_vault_arm_id = key_vault_arm_id - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = properties - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'Kubernetes' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: KubernetesOnlineDeployment, ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = "Standard_F4s_v2", - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. Default: Standard_F4s_v2. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) - self.app_insights_enabled = app_insights_enabled - self.data_collector = data_collector - self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = instance_type - self.liveness_probe = liveness_probe - self.model = model - self.model_mount_path = model_mount_path - self.provisioning_state = None - self.readiness_probe = readiness_probe - self.request_settings = request_settings - self.scale_settings = scale_settings - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a KubernetesOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = "Standard_F4s_v2", - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. Default: Standard_F4s_v2. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - :keyword container_resource_requirements: The resource requirements for the container (cpu and - memory). - :paramtype container_resource_requirements: - ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements - """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = container_resource_requirements - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = "default", - default_instance_type: Optional[str] = None, - instance_types: Optional[Dict[str, "InstanceTypeSchema"]] = None, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = relay_connection_string - self.service_bus_connection_string = service_bus_connection_string - self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train - self.vc_name = vc_name - self.namespace = namespace - self.default_instance_type = default_instance_type - self.instance_types = instance_types - - -class LabelGeneration(DataGenerationVertical): - """LabelGeneration. - - All required parameters must be populated in order to send to Azure. - - :ivar data_generation_task_type: Required. [Required] DataGeneration Task type. Possible values - include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :vartype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :ivar data_generation_type: Required. [Required] Enum to determine the type of Data - Generation.Constant filled by server. Possible values include: "LabelGeneration", - "DataGeneration". - :vartype data_generation_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationType - :ivar prompt_settings: Prompt Settings. - :vartype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :ivar teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :vartype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :ivar teacher_model_settings: - :vartype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - :ivar training_data: Training data for fine tuning. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - - _validation = { - 'data_generation_task_type': {'required': True}, - 'data_generation_type': {'required': True}, - 'teacher_model_endpoint': {'required': True}, - } - - _attribute_map = { - 'data_generation_task_type': {'key': 'dataGenerationTaskType', 'type': 'str'}, - 'data_generation_type': {'key': 'dataGenerationType', 'type': 'str'}, - 'prompt_settings': {'key': 'promptSettings', 'type': 'PromptSettings'}, - 'teacher_model_endpoint': {'key': 'teacherModelEndpoint', 'type': 'TeacherModelEndpoint'}, - 'teacher_model_settings': {'key': 'teacherModelSettings', 'type': 'TeacherModelSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, - 'validation_data': {'key': 'validationData', 'type': 'JobInput'}, - } - - def __init__( - self, - *, - data_generation_task_type: Union[str, "DataGenerationTaskType"], - teacher_model_endpoint: "TeacherModelEndpoint", - prompt_settings: Optional["PromptSettings"] = None, - teacher_model_settings: Optional["TeacherModelSettings"] = None, - training_data: Optional["JobInput"] = None, - validation_data: Optional["JobInput"] = None, - **kwargs - ): - """ - :keyword data_generation_task_type: Required. [Required] DataGeneration Task type. Possible - values include: "Conversation", "Math", "Nli", "NluQa", "Summarization". - :paramtype data_generation_task_type: str or - ~azure.mgmt.machinelearningservices.models.DataGenerationTaskType - :keyword prompt_settings: Prompt Settings. - :paramtype prompt_settings: ~azure.mgmt.machinelearningservices.models.PromptSettings - :keyword teacher_model_endpoint: Required. [Required] Teacher Model Endpoint Details. - :paramtype teacher_model_endpoint: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpoint - :keyword teacher_model_settings: - :paramtype teacher_model_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelSettings - :keyword training_data: Training data for fine tuning. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.JobInput - :keyword validation_data: Validation data for fine tuning. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.JobInput - """ - super(LabelGeneration, self).__init__(data_generation_task_type=data_generation_task_type, prompt_settings=prompt_settings, teacher_model_endpoint=teacher_model_endpoint, teacher_model_settings=teacher_model_settings, **kwargs) - self.data_generation_type = 'LabelGeneration' # type: str - self.training_data = training_data - self.validation_data = validation_data - - -class OneLakeArtifact(msrest.serialization.Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = artifact_name - self.artifact_type = None # type: Optional[str] - - -class LakeHouseArtifact(OneLakeArtifact): - """LakeHouseArtifact. - - All required parameters must be populated in order to send to Azure. - - :ivar artifact_name: Required. [Required] OneLake artifact name. - :vartype artifact_name: str - :ivar artifact_type: Required. [Required] OneLake artifact type.Constant filled by server. - Possible values include: "LakeHouse". - :vartype artifact_type: str or ~azure.mgmt.machinelearningservices.models.OneLakeArtifactType - """ - - _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): - """ - :keyword artifact_name: Required. [Required] OneLake artifact name. - :paramtype artifact_name: str - """ - super(LakeHouseArtifact, self).__init__(artifact_name=artifact_name, **kwargs) - self.artifact_type = 'LakeHouse' # type: str - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - _validation = { - 'app_insights_instrumentation_key': {'readonly': True}, - 'user_storage_arm_id': {'readonly': True}, - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - 'user_storage_arm_id': {'key': 'userStorageArmId', 'type': 'str'}, - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - *, - container_registry_credentials: Optional["RegistryListCredentialsResult"] = None, - notebook_access_keys: Optional["ListNotebookKeysResult"] = None, - **kwargs - ): - """ - :keyword container_registry_credentials: - :paramtype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :keyword notebook_access_keys: - :paramtype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.app_insights_instrumentation_key = None - self.container_registry_credentials = container_registry_credentials - self.notebook_access_keys = notebook_access_keys - self.user_storage_arm_id = None - self.user_storage_key = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class LiteralJobInput(JobInput): - """Literal input type. - - All required parameters must be populated in order to send to Azure. - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar value: Required. [Required] Literal value for the input. - :vartype value: str - """ - - _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description for the input. - :paramtype description: str - :keyword value: Required. [Required] Literal value for the input. - :paramtype value: str - """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str - self.value = value - - -class ManagedComputeIdentity(MonitorComputeIdentityBase): - """Managed compute identity definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_identity_type: Required. [Required] Specifies the type of identity to use within - the monitoring jobs.Constant filled by server. Possible values include: "AmlToken", - "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: The identity which will be leveraged by the monitoring jobs. - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - - _validation = { - 'compute_identity_type': {'required': True}, - } - - _attribute_map = { - 'compute_identity_type': {'key': 'computeIdentityType', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword identity: The identity which will be leveraged by the monitoring jobs. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - """ - super(ManagedComputeIdentity, self).__init__(**kwargs) - self.compute_identity_type = 'ManagedIdentity' # type: str - self.identity = identity - - -class ManagedIdentity(IdentityConfiguration): - """Managed identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do - not set this field. - :paramtype client_id: str - :keyword object_id: Specifies a user-assigned identity by object ID. For system-assigned, do - not set this field. - :paramtype object_id: str - :keyword resource_id: Specifies a user-assigned identity by ARM resource ID. For - system-assigned, do not set this field. - :paramtype resource_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = client_id - self.object_id = object_id - self.resource_id = resource_id - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -class ManagedIdentityCredential(DataReferenceCredential): - """Credential for user managed identity. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'managed_identity_type': {'key': 'managedIdentityType', 'type': 'str'}, - 'user_managed_identity_client_id': {'key': 'userManagedIdentityClientId', 'type': 'str'}, - 'user_managed_identity_principal_id': {'key': 'userManagedIdentityPrincipalId', 'type': 'str'}, - 'user_managed_identity_resource_id': {'key': 'userManagedIdentityResourceId', 'type': 'str'}, - 'user_managed_identity_tenant_id': {'key': 'userManagedIdentityTenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - managed_identity_type: Optional[str] = None, - user_managed_identity_client_id: Optional[str] = None, - user_managed_identity_principal_id: Optional[str] = None, - user_managed_identity_resource_id: Optional[str] = None, - user_managed_identity_tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword managed_identity_type: ManagedIdentityCredential identity type. - :paramtype managed_identity_type: str - :keyword user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_client_id: str - :keyword user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_principal_id: str - :keyword user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType - = SystemManaged, this field is null. - :paramtype user_managed_identity_resource_id: str - :keyword user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :paramtype user_managed_identity_tenant_id: str - """ - super(ManagedIdentityCredential, self).__init__(**kwargs) - self.credential_type = 'ManagedIdentity' # type: str - self.managed_identity_type = managed_identity_type - self.user_managed_identity_client_id = user_managed_identity_client_id - self.user_managed_identity_principal_id = user_managed_identity_principal_id - self.user_managed_identity_resource_id = user_managed_identity_resource_id - self.user_managed_identity_tenant_id = user_managed_identity_tenant_id - - -class ManagedNetworkProvisionOptions(msrest.serialization.Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, - } - - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): - """ - :keyword include_spark: - :paramtype include_spark: bool - """ - super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = include_spark - - -class ManagedNetworkProvisionStatus(msrest.serialization.Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Possible values - include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - - _attribute_map = { - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - spark_ready: Optional[bool] = None, - status: Optional[Union[str, "ManagedNetworkStatus"]] = None, - **kwargs - ): - """ - :keyword spark_ready: - :paramtype spark_ready: bool - :keyword status: Status for the managed network of a machine learning workspace. Possible - values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ManagedNetworkStatus - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.spark_ready = spark_ready - self.status = status - - -class ManagedNetworkSettings(msrest.serialization.Model): - """Managed Network settings for a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. - :vartype firewall_public_ip_address: str - :ivar firewall_sku: Firewall Sku used for FQDN Rules. Possible values include: "Standard", - "Basic". - :vartype firewall_sku: str or ~azure.mgmt.machinelearningservices.models.FirewallSku - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Possible values include: "Disabled", "AllowInternetOutbound", "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of :code:``. - :vartype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.machinelearningservices.models.IsolationMode] - """ - - _validation = { - 'firewall_public_ip_address': {'readonly': True}, - 'network_id': {'readonly': True}, - 'changeable_isolation_modes': {'readonly': True}, - } - - _attribute_map = { - 'firewall_public_ip_address': {'key': 'firewallPublicIpAddress', 'type': 'str'}, - 'firewall_sku': {'key': 'firewallSku', 'type': 'str'}, - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, - 'changeable_isolation_modes': {'key': 'changeableIsolationModes', 'type': '[str]'}, - } - - def __init__( - self, - *, - firewall_sku: Optional[Union[str, "FirewallSku"]] = None, - isolation_mode: Optional[Union[str, "IsolationMode"]] = None, - outbound_rules: Optional[Dict[str, "OutboundRule"]] = None, - status: Optional["ManagedNetworkProvisionStatus"] = None, - **kwargs - ): - """ - :keyword firewall_sku: Firewall Sku used for FQDN Rules. Possible values include: "Standard", - "Basic". - :paramtype firewall_sku: str or ~azure.mgmt.machinelearningservices.models.FirewallSku - :keyword isolation_mode: Isolation mode for the managed network of a machine learning - workspace. Possible values include: "Disabled", "AllowInternetOutbound", - "AllowOnlyApprovedOutbound". - :paramtype isolation_mode: str or ~azure.mgmt.machinelearningservices.models.IsolationMode - :keyword outbound_rules: Dictionary of :code:``. - :paramtype outbound_rules: dict[str, ~azure.mgmt.machinelearningservices.models.OutboundRule] - :keyword status: Status of the Provisioning for the managed network of a machine learning - workspace. - :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus - """ - super(ManagedNetworkSettings, self).__init__(**kwargs) - self.firewall_public_ip_address = None - self.firewall_sku = firewall_sku - self.isolation_mode = isolation_mode - self.network_id = None - self.outbound_rules = outbound_rules - self.status = status - self.changeable_isolation_modes = None - - -class ManagedOnlineDeployment(OnlineDeploymentProperties): - """Properties specific to a ManagedOnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :ivar egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :vartype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: Required. [Required] The compute type of the endpoint.Constant - filled by server. Possible values include: "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Possible values - include: "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - properties: Optional[Dict[str, str]] = None, - app_insights_enabled: Optional[bool] = False, - data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = "Standard_F4s_v2", - liveness_probe: Optional["ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["ProbeSettings"] = None, - request_settings: Optional["OnlineRequestSettings"] = None, - scale_settings: Optional["OnlineScaleSettings"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for the endpoint deployment. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - :keyword description: Description of the endpoint deployment. - :paramtype description: str - :keyword environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :paramtype environment_id: str - :keyword environment_variables: Environment variables configuration for the deployment. - :paramtype environment_variables: dict[str, str] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword app_insights_enabled: If true, enables Application Insights logging. - :paramtype app_insights_enabled: bool - :keyword data_collector: The mdc configuration, we disable mdc when it's null. - :paramtype data_collector: ~azure.mgmt.machinelearningservices.models.DataCollector - :keyword egress_public_network_access: If Enabled, allow egress public network access. If - Disabled, this will create secure egress. Default: Enabled. Possible values include: "Enabled", - "Disabled". - :paramtype egress_public_network_access: str or - ~azure.mgmt.machinelearningservices.models.EgressPublicNetworkAccessType - :keyword instance_type: Compute instance type. Default: Standard_F4s_v2. - :paramtype instance_type: str - :keyword liveness_probe: Liveness probe monitors the health of the container regularly. - :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword model: The URI path to the model. - :paramtype model: str - :keyword model_mount_path: The path to mount the model in custom container. - :paramtype model_mount_path: str - :keyword readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings - :keyword request_settings: Request settings for the deployment. - :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings - :keyword scale_settings: Scale settings for the deployment. - If it is null or not provided, - it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment - and to DefaultScaleSettings for ManagedOnlineDeployment. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings - """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str - - -class ManagedOnlineEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties): - """ManagedOnlineEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - :ivar endpoint_compute_type: Enum to determine endpoint compute type. Possible values include: - "Managed", "Kubernetes", "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :ivar model: - :vartype model: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - } - - def __init__( - self, - *, - failure_reason: Optional[str] = None, - endpoint_compute_type: Optional[Union[str, "EndpointComputeType"]] = None, - model: Optional[str] = None, - **kwargs - ): - """ - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword endpoint_compute_type: Enum to determine endpoint compute type. Possible values - include: "Managed", "Kubernetes", "AzureMLCompute". - :paramtype endpoint_compute_type: str or - ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :keyword model: - :paramtype model: str - """ - super(ManagedOnlineEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, **kwargs) - self.type = 'managedOnlineEndpoint' # type: str - self.endpoint_compute_type = endpoint_compute_type - self.model = model - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties): - """ManagedOnlineEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar compute: - :vartype compute: str - :ivar description: - :vartype description: str - :ivar mirror_traffic: Dictionary of :code:``. - :vartype mirror_traffic: dict[str, int] - :ivar scoring_uri: - :vartype scoring_uri: str - :ivar traffic: Dictionary of :code:``. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - auth_mode: Optional[Union[str, "EndpointAuthMode"]] = None, - compute: Optional[str] = None, - description: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - scoring_uri: Optional[str] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Enum to determine endpoint authentication mode. Possible values include: - "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword compute: - :paramtype compute: str - :keyword description: - :paramtype description: str - :keyword mirror_traffic: Dictionary of :code:``. - :paramtype mirror_traffic: dict[str, int] - :keyword scoring_uri: - :paramtype scoring_uri: str - :keyword traffic: Dictionary of :code:``. - :paramtype traffic: dict[str, int] - """ - super(ManagedOnlineEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'managedOnlineEndpoint' # type: str - self.auth_mode = auth_mode - self.compute = compute - self.description = description - self.mirror_traffic = mirror_traffic - self.scoring_uri = scoring_uri - self.traffic = traffic - - -class ManagedResourceGroupAssignedIdentities(msrest.serialization.Model): - """Details for managed resource group assigned identities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ManagedResourceGroupAssignedIdentities, self).__init__(**kwargs) - self.principal_id = None - - -class ManagedResourceGroupSettings(msrest.serialization.Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - - _attribute_map = { - 'assigned_identities': {'key': 'assignedIdentities', 'type': '[ManagedResourceGroupAssignedIdentities]'}, - } - - def __init__( - self, - *, - assigned_identities: Optional[List["ManagedResourceGroupAssignedIdentities"]] = None, - **kwargs - ): - """ - :keyword assigned_identities: List of assigned identities for the managed resource group. - :paramtype assigned_identities: - list[~azure.mgmt.machinelearningservices.models.ManagedResourceGroupAssignedIdentities] - """ - super(ManagedResourceGroupSettings, self).__init__(**kwargs) - self.assigned_identities = assigned_identities - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MarketplacePlan(msrest.serialization.Model): - """MarketplacePlan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar offer_id: The identifying name of the Offer of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The identifying name of the Plan of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The identifying name of the Publisher of the Marketplace Plan. - :vartype publisher_id: str - """ - - _validation = { - 'offer_id': {'readonly': True}, - 'plan_id': {'readonly': True}, - 'publisher_id': {'readonly': True}, - } - - _attribute_map = { - 'offer_id': {'key': 'offerId', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MarketplacePlan, self).__init__(**kwargs) - self.offer_id = None - self.plan_id = None - self.publisher_id = None - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'MarketplaceSubscriptionProperties'}, - } - - def __init__( - self, - *, - properties: "MarketplaceSubscriptionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProperties - """ - super(MarketplaceSubscription, self).__init__(**kwargs) - self.properties = properties - - -class MarketplaceSubscriptionProperties(msrest.serialization.Model): - """MarketplaceSubscriptionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: ~azure.mgmt.machinelearningservices.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Possible - values include: "Subscribed", "Suspended", "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionStatus - :ivar model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Possible values - include: "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionProvisioningState - """ - - _validation = { - 'marketplace_plan': {'readonly': True}, - 'marketplace_subscription_status': {'readonly': True}, - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'marketplace_plan': {'key': 'marketplacePlan', 'type': 'MarketplacePlan'}, - 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. [Required] Target Marketplace Model ID to create a Marketplace - Subscription for. - :paramtype model_id: str - """ - super(MarketplaceSubscriptionProperties, self).__init__(**kwargs) - self.marketplace_plan = None - self.marketplace_subscription_status = None - self.model_id = model_id - self.provisioning_state = None - - -class MarketplaceSubscriptionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of MarketplaceSubscription entities. - - :ivar next_link: The link to the next page of MarketplaceSubscription objects. If null, there - are no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type MarketplaceSubscription. - :vartype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MarketplaceSubscription]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["MarketplaceSubscription"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of MarketplaceSubscription objects. If null, - there are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type MarketplaceSubscription. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - """ - super(MarketplaceSubscriptionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MaterializationComputeResource(msrest.serialization.Model): - """DTO object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - **kwargs - ): - """ - :keyword instance_type: Specifies the instance type. - :paramtype instance_type: str - """ - super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = instance_type - - -class MaterializationSettings(msrest.serialization.Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Possible values - include: "None", "Online", "Offline", "OnlineAndOffline". - :vartype store_type: str or ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - - _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, - } - - def __init__( - self, - *, - notification: Optional["NotificationSetting"] = None, - resource: Optional["MaterializationComputeResource"] = None, - schedule: Optional["RecurrenceTrigger"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - store_type: Optional[Union[str, "MaterializationStoreType"]] = None, - **kwargs - ): - """ - :keyword notification: Specifies the notification details. - :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword resource: Specifies the compute resource settings. - :paramtype resource: ~azure.mgmt.machinelearningservices.models.MaterializationComputeResource - :keyword schedule: Specifies the schedule details. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword spark_configuration: Specifies the spark compute settings. - :paramtype spark_configuration: dict[str, str] - :keyword store_type: Specifies the stores to which materialization should happen. Possible - values include: "None", "Online", "Offline", "OnlineAndOffline". - :paramtype store_type: str or - ~azure.mgmt.machinelearningservices.models.MaterializationStoreType - """ - super(MaterializationSettings, self).__init__(**kwargs) - self.notification = notification - self.resource = resource - self.schedule = schedule - self.spark_configuration = spark_configuration - self.store_type = store_type - - -class MedianStoppingPolicy(EarlyTerminationPolicy): - """Defines an early termination policy based on running averages of the primary metric of all runs. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str - - -class MLFlowModelJobInput(JobInput, AssetJobInput): - """MLFlowModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mlflow_model' # type: str - self.description = description - - -class MLFlowModelJobOutput(JobOutput, AssetJobOutput): - """MLFlowModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.mode = mode - self.uri = uri - self.job_output_type = 'mlflow_model' # type: str - self.description = description - - -class MLTableData(DataVersionBaseProperties): - """MLTable data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - referenced_uris: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :paramtype referenced_uris: list[str] - """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = referenced_uris - - -class MLTableJobInput(JobInput, AssetJobInput): - """MLTableJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'mltable' # type: str - self.description = description - - -class MLTableJobOutput(JobOutput, AssetJobOutput): - """MLTableJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.mode = mode - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, - } - - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties - """ - super(ModelContainer, self).__init__(**kwargs) - self.properties = properties - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - """ - - _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) - self.provisioning_state = None - - -class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelContainer entities. - - :ivar next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelContainer. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelContainer"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelContainer. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] - """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ModelSettings(msrest.serialization.Model): - """ModelSettings. - - :ivar model_id: The unique model identifier that this ServerlessEndpoint should provision. - :vartype model_id: str - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword model_id: The unique model identifier that this ServerlessEndpoint should provision. - :paramtype model_id: str - """ - super(ModelSettings, self).__init__(**kwargs) - self.model_id = model_id - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, - } - - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties - """ - super(ModelVersion, self).__init__(**kwargs) - self.properties = properties - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - stage: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword job_name: Name of the training job which produced this model. - :paramtype job_name: str - :keyword model_type: The storage format for this entity. Used for NCD. - :paramtype model_type: str - :keyword model_uri: The URI path to the model contents. - :paramtype model_uri: str - :keyword stage: Stage in the model lifecycle assigned to this model. - :paramtype stage: str - """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.job_name = job_name - self.model_type = model_type - self.model_uri = model_uri - self.provisioning_state = None - self.stage = stage - - -class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ModelVersion entities. - - :ivar next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ModelVersion. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ModelVersion"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ModelVersion. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] - """ - super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class MonitorComputeConfigurationBase(msrest.serialization.Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MonitorServerlessSparkCompute. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'ServerlessSpark': 'MonitorServerlessSparkCompute'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitorComputeConfigurationBase, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class MonitorDefinition(msrest.serialization.Model): - """MonitorDefinition. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :ivar compute_configuration: Required. [Required] The ARM resource ID of the compute resource - to run the monitoring job on. - :vartype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The entities targeted by the monitor. - :vartype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :ivar signals: Required. [Required] The signals to monitor. - :vartype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - - _validation = { - 'compute_configuration': {'required': True}, - 'signals': {'required': True}, - } - - _attribute_map = { - 'alert_notification_settings': {'key': 'alertNotificationSettings', 'type': 'MonitorNotificationSettings'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - *, - compute_configuration: "MonitorComputeConfigurationBase", - signals: Dict[str, "MonitoringSignalBase"], - alert_notification_settings: Optional["MonitorNotificationSettings"] = None, - monitoring_target: Optional["MonitoringTarget"] = None, - **kwargs - ): - """ - :keyword alert_notification_settings: The monitor's notification settings. - :paramtype alert_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorNotificationSettings - :keyword compute_configuration: Required. [Required] The ARM resource ID of the compute - resource to run the monitoring job on. - :paramtype compute_configuration: - ~azure.mgmt.machinelearningservices.models.MonitorComputeConfigurationBase - :keyword monitoring_target: The entities targeted by the monitor. - :paramtype monitoring_target: ~azure.mgmt.machinelearningservices.models.MonitoringTarget - :keyword signals: Required. [Required] The signals to monitor. - :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] - """ - super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_settings = alert_notification_settings - self.compute_configuration = compute_configuration - self.monitoring_target = monitoring_target - self.signals = signals - - -class MonitorEmailNotificationSettings(msrest.serialization.Model): - """MonitorEmailNotificationSettings. - - :ivar emails: The email recipient list which has a limitation of 499 characters in total. - :vartype emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__( - self, - *, - emails: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword emails: The email recipient list which has a limitation of 499 characters in total. - :paramtype emails: list[str] - """ - super(MonitorEmailNotificationSettings, self).__init__(**kwargs) - self.emails = emails - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: Reference to the deployment asset targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: Reference to the model asset targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - - _validation = { - 'task_type': {'required': True}, - } - - _attribute_map = { - 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - } - - def __init__( - self, - *, - task_type: Union[str, "ModelTaskType"], - deployment_id: Optional[str] = None, - model_id: Optional[str] = None, - **kwargs - ): - """ - :keyword deployment_id: Reference to the deployment asset targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: Reference to the model asset targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the monitored model. - Possible values include: "Classification", "Regression". - :paramtype task_type: str or ~azure.mgmt.machinelearningservices.models.ModelTaskType - """ - super(MonitoringTarget, self).__init__(**kwargs) - self.deployment_id = deployment_id - self.model_id = model_id - self.task_type = task_type - - -class MonitoringThreshold(msrest.serialization.Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__( - self, - *, - value: Optional[float] = None, - **kwargs - ): - """ - :keyword value: The threshold value. If null, the set default is dependent on the metric type. - :paramtype value: float - """ - super(MonitoringThreshold, self).__init__(**kwargs) - self.value = value - - -class MonitorNotificationSettings(msrest.serialization.Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - - _attribute_map = { - 'email_notification_settings': {'key': 'emailNotificationSettings', 'type': 'MonitorEmailNotificationSettings'}, - } - - def __init__( - self, - *, - email_notification_settings: Optional["MonitorEmailNotificationSettings"] = None, - **kwargs - ): - """ - :keyword email_notification_settings: The AML notification email settings. - :paramtype email_notification_settings: - ~azure.mgmt.machinelearningservices.models.MonitorEmailNotificationSettings - """ - super(MonitorNotificationSettings, self).__init__(**kwargs) - self.email_notification_settings = email_notification_settings - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase): - """Monitor serverless spark compute definition. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "ServerlessSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.MonitorComputeType - :ivar compute_identity: Required. [Required] The identity scheme leveraged to by the spark jobs - running on serverless Spark. - :vartype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :ivar instance_type: Required. [Required] The instance type running the Spark job. - :vartype instance_type: str - :ivar runtime_version: Required. [Required] The Spark runtime version. - :vartype runtime_version: str - """ - - _validation = { - 'compute_type': {'required': True}, - 'compute_identity': {'required': True}, - 'instance_type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'runtime_version': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]+\.[0-9]+$'}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_identity': {'key': 'computeIdentity', 'type': 'MonitorComputeIdentityBase'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - compute_identity: "MonitorComputeIdentityBase", - instance_type: str, - runtime_version: str, - **kwargs - ): - """ - :keyword compute_identity: Required. [Required] The identity scheme leveraged to by the spark - jobs running on serverless Spark. - :paramtype compute_identity: - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityBase - :keyword instance_type: Required. [Required] The instance type running the Spark job. - :paramtype instance_type: str - :keyword runtime_version: Required. [Required] The Spark runtime version. - :paramtype runtime_version: str - """ - super(MonitorServerlessSparkCompute, self).__init__(**kwargs) - self.compute_type = 'ServerlessSpark' # type: str - self.compute_identity = compute_identity - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class Mpi(DistributionConfiguration): - """MPI distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per MPI node. - :paramtype process_count_per_instance: int - """ - super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = process_count_per_instance - - -class NetworkAcls(msrest.serialization.Model): - """NetworkAcls. - - :ivar default_action: The default action when no rule from ipRules and from virtualNetworkRules - match. This is only used after the bypass property has been evaluated. Possible values include: - "Deny", "Allow". - :vartype default_action: str or ~azure.mgmt.machinelearningservices.models.DefaultActionType - :ivar ip_rules: Rules governing the accessibility of a resource from a specific ip address or - ip range. - :vartype ip_rules: list[~azure.mgmt.machinelearningservices.models.IPRule] - """ - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__( - self, - *, - default_action: Optional[Union[str, "DefaultActionType"]] = None, - ip_rules: Optional[List["IPRule"]] = None, - **kwargs - ): - """ - :keyword default_action: The default action when no rule from ipRules and from - virtualNetworkRules match. This is only used after the bypass property has been evaluated. - Possible values include: "Deny", "Allow". - :paramtype default_action: str or ~azure.mgmt.machinelearningservices.models.DefaultActionType - :keyword ip_rules: Rules governing the accessibility of a resource from a specific ip address - or ip range. - :paramtype ip_rules: list[~azure.mgmt.machinelearningservices.models.IPRule] - """ - super(NetworkAcls, self).__init__(**kwargs) - self.default_action = default_action - self.ip_rules = ip_rules - - -class NlpVertical(msrest.serialization.Model): - """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - - -class NlpVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_trials = max_trials - self.timeout = timeout - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'None' # type: str - - -class NoneDatastoreCredentials(DatastoreCredentials): - """Empty/none datastore credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - """ - - _validation = { - 'credentials_type': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - _validation = { - 'access_token': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'host_name': {'readonly': True}, - 'notebook_resource_id': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - 'token_type': {'readonly': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.access_token = None - self.expires_in = None - self.host_name = None - self.notebook_resource_id = None - self.public_dns = None - self.refresh_token = None - self.scope = None - self.token_type = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = error_message - self.status_code = status_code - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'is_private_link_enabled': {'key': 'isPrivateLinkEnabled', 'type': 'bool'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - is_private_link_enabled: Optional[bool] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword is_private_link_enabled: - :paramtype is_private_link_enabled: bool - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = fqdn - self.is_private_link_enabled = is_private_link_enabled - self.notebook_preparation_error = notebook_preparation_error - self.resource_id = resource_id - - -class NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - - _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, - emails: Optional[List[str]] = None, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notification type. - :paramtype email_on: list[str or - ~azure.mgmt.machinelearningservices.models.EmailNotificationEnableType] - :keyword emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :paramtype emails: list[str] - :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = email_on - self.emails = emails - self.webhooks = webhooks - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): - """NumericalDataDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric - """ - super(NumericalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): - """NumericalDataQualityMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :vartype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalDataQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical data quality metric to calculate. Possible - values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". - :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric - """ - super(NumericalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): - """NumericalPredictionDriftMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar data_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Numerical", "Categorical". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :ivar metric: Required. [Required] The numerical prediction drift metric to calculate. Possible - values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - - _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "NumericalPredictionDriftMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - :keyword metric: Required. [Required] The numerical prediction drift metric to calculate. - Possible values include: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric - """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str - self.metric = metric - - -class OAuth2AuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """OAuth2AuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionOAuth2'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionOAuth2"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionOAuth2 - """ - super(OAuth2AuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'OAuth2' # type: str - self.credentials = credentials - - -class Objective(msrest.serialization.Model): - """Optimization objective. - - All required parameters must be populated in order to send to Azure. - - :ivar goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :vartype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :ivar primary_metric: Required. [Required] Name of the metric to optimize. - :vartype primary_metric: str - """ - - _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs - ): - """ - :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. - Possible values include: "Minimize", "Maximize". - :paramtype goal: str or ~azure.mgmt.machinelearningservices.models.Goal - :keyword primary_metric: Required. [Required] Name of the metric to optimize. - :paramtype primary_metric: str - """ - super(Objective, self).__init__(**kwargs) - self.goal = goal - self.primary_metric = primary_metric - - -class OneLakeDatastore(DatastoreProperties): - """OneLake (Trident) datastore configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: Required. [Required] Account credentials. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :ivar datastore_type: Required. [Required] Storage type backing the datastore.Constant filled - by server. Possible values include: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", - "AzureFile", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: Required. [Required] OneLake artifact backing the datastore. - :vartype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: Required. [Required] OneLake workspace name. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - - _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - artifact: "OneLakeArtifact", - one_lake_workspace_name: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword credentials: Required. [Required] Account credentials. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials - :keyword artifact: Required. [Required] OneLake artifact backing the datastore. - :paramtype artifact: ~azure.mgmt.machinelearningservices.models.OneLakeArtifact - :keyword endpoint: OneLake endpoint to use for the datastore. - :paramtype endpoint: str - :keyword one_lake_workspace_name: Required. [Required] OneLake workspace name. - :paramtype one_lake_workspace_name: str - :keyword service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Possible values include: "None", - "WorkspaceSystemAssignedIdentity", "WorkspaceUserAssignedIdentity". - :paramtype service_data_access_auth_identity: str or - ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity - """ - super(OneLakeDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = artifact - self.endpoint = endpoint - self.one_lake_workspace_name = one_lake_workspace_name - self.service_data_access_auth_identity = service_data_access_auth_identity - - -class OnlineDeployment(TrackedResource): - """OnlineDeployment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineDeploymentProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineDeployment entities. - - :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineDeployment. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineDeployment"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineDeployment. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineEndpoint(TrackedResource): - """OnlineEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "OnlineEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OnlineEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] The authentication method for invoking the endpoint (data - plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine - Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :vartype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :vartype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. - optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - :ivar public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "EndpointAuthMode"], - description: Optional[str] = None, - keys: Optional["EndpointAuthKeys"] = None, - properties: Optional[Dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - traffic: Optional[Dict[str, int]] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] The authentication method for invoking the endpoint - (data plane operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure - Machine Learning token-based authentication. Use 'AADToken' for Microsoft Entra token-based - authentication. Possible values include: "AMLToken", "Key", "AADToken". - :paramtype auth_mode: str or ~azure.mgmt.machinelearningservices.models.EndpointAuthMode - :keyword description: Description of the inference endpoint. - :paramtype description: str - :keyword keys: EndpointAuthKeys to set initially on an Endpoint. - This property will always be returned as null. AuthKey values must be retrieved using the - ListKeys API. - :paramtype keys: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword compute: ARM resource ID of the compute if it exists. - optional. - :paramtype compute: str - :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :paramtype mirror_traffic: dict[str, int] - :keyword public_network_access: Set to "Enabled" for endpoints that should allow public access - when Private Link is enabled. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic - values need to sum to 100. - :paramtype traffic: dict[str, int] - """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) - self.compute = compute - self.mirror_traffic = mirror_traffic - self.provisioning_state = None - self.public_network_access = public_network_access - self.traffic = traffic - - -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of OnlineEndpoint entities. - - :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type OnlineEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OnlineEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type OnlineEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OnlineRequestSettings(msrest.serialization.Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - max_queue_wait: Optional[datetime.timedelta] = "PT0.5S", - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. - Defaults to 500ms. - (Now increase ``request_timeout_ms`` to account for any networking/queue delays). - :paramtype max_queue_wait: ~datetime.timedelta - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.max_queue_wait = max_queue_wait - self.request_timeout = request_timeout - - -class OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """OpenAIEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(OpenAIEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.OpenAI' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties): - """OpenAIEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(OpenAIEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.OpenAI' # type: str - - -class Operation(msrest.serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.machinelearningservices.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OsPatchingStatus(msrest.serialization.Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Possible values include: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", "Unknown". - :vartype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - :ivar os_patching_errors: Collection of errors encountered when doing os patching. - :vartype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - - _attribute_map = { - 'patch_status': {'key': 'patchStatus', 'type': 'str'}, - 'latest_patch_time': {'key': 'latestPatchTime', 'type': 'str'}, - 'reboot_pending': {'key': 'rebootPending', 'type': 'bool'}, - 'scheduled_reboot_time': {'key': 'scheduledRebootTime', 'type': 'str'}, - 'os_patching_errors': {'key': 'osPatchingErrors', 'type': '[ErrorResponse]'}, - } - - def __init__( - self, - *, - patch_status: Optional[Union[str, "PatchStatus"]] = None, - latest_patch_time: Optional[str] = None, - reboot_pending: Optional[bool] = None, - scheduled_reboot_time: Optional[str] = None, - os_patching_errors: Optional[List["ErrorResponse"]] = None, - **kwargs - ): - """ - :keyword patch_status: The os patching status. Possible values include: - "CompletedWithWarnings", "Failed", "InProgress", "Succeeded", "Unknown". - :paramtype patch_status: str or ~azure.mgmt.machinelearningservices.models.PatchStatus - :keyword latest_patch_time: Time of the latest os patching. - :paramtype latest_patch_time: str - :keyword reboot_pending: Specifies whether this compute instance is pending for reboot to - finish os patching. - :paramtype reboot_pending: bool - :keyword scheduled_reboot_time: Time of scheduled reboot. - :paramtype scheduled_reboot_time: str - :keyword os_patching_errors: Collection of errors encountered when doing os patching. - :paramtype os_patching_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - """ - super(OsPatchingStatus, self).__init__(**kwargs) - self.patch_status = patch_status - self.latest_patch_time = latest_patch_time - self.reboot_pending = reboot_pending - self.scheduled_reboot_time = scheduled_reboot_time - self.os_patching_errors = os_patching_errors - - -class OutboundRuleBasicResource(Resource): - """OutboundRuleBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :vartype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, - } - - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): - """ - :keyword properties: Required. Outbound Rule for the managed network of a machine learning - workspace. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule - """ - super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class OutboundRuleListResult(msrest.serialization.Model): - """List of outbound rules for the managed network of a machine learning workspace. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["OutboundRuleBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class OutputPathAssetReference(AssetReferenceBase): - """Reference to an asset via its path in a job output. - - All required parameters must be populated in order to send to Azure. - - :ivar reference_type: Required. [Required] Specifies the type of asset reference.Constant - filled by server. Possible values include: "Id", "DataPath", "OutputPath". - :vartype reference_type: str or ~azure.mgmt.machinelearningservices.models.ReferenceType - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - """ - - _validation = { - 'reference_type': {'required': True}, - } - - _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword job_id: ARM resource ID of the job. - :paramtype job_id: str - :keyword path: The path of the file/directory in the job output. - :paramtype path: str - """ - super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = job_id - self.path = path - - -class PackageDetails(msrest.serialization.Model): - """PackageDetails. - - :ivar install_path: Install path. - :vartype install_path: str - :ivar installed_version: Installed version. - :vartype installed_version: str - :ivar name: Package or dependency name. - :vartype name: str - :ivar patched_version: Patched version. - :vartype patched_version: str - """ - - _attribute_map = { - 'install_path': {'key': 'installPath', 'type': 'str'}, - 'installed_version': {'key': 'installedVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'patched_version': {'key': 'patchedVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - install_path: Optional[str] = None, - installed_version: Optional[str] = None, - name: Optional[str] = None, - patched_version: Optional[str] = None, - **kwargs - ): - """ - :keyword install_path: Install path. - :paramtype install_path: str - :keyword installed_version: Installed version. - :paramtype installed_version: str - :keyword name: Package or dependency name. - :paramtype name: str - :keyword patched_version: Patched version. - :paramtype patched_version: str - """ - super(PackageDetails, self).__init__(**kwargs) - self.install_path = install_path - self.installed_version = installed_version - self.name = name - self.patched_version = patched_version - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ComputeResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartialBatchDeployment(msrest.serialization.Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the endpoint deployment. - :paramtype description: str - """ - super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = description - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - properties: Optional["PartialBatchDeployment"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class PartialManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword type: Managed service identity (system assigned and/or user assigned identities). - Possible values include: "None", "SystemAssigned", "UserAssigned", - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, any] - """ - super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class PartialMinimalTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = tags - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) - self.sku = sku - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - """ - super(PartialMinimalTrackedResourceWithSkuAndIdentity, self).__init__(tags=tags, **kwargs) - self.identity = identity - self.sku = sku - - -class PartialRegistryPartialTrackedResource(msrest.serialization.Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'RegistryPartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["RegistryPartialManagedServiceIdentity"] = None, - sku: Optional["PartialSku"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: - ~azure.mgmt.machinelearningservices.models.RegistryPartialManagedServiceIdentity - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - - -class PartialSku(msrest.serialization.Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(PartialSku, self).__init__(**kwargs) - self.capacity = capacity - self.family = family - self.name = name - self.size = size - self.tier = tier - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -class PendingUploadCredentialDto(msrest.serialization.Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PendingUploadCredentialDto, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class PendingUploadRequestDto(msrest.serialization.Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PendingUploadResponseDto(msrest.serialization.Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Possible values - include: "None", "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - - _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, - } - - def __init__( - self, - *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, - **kwargs - ): - """ - :keyword blob_reference_for_consumption: Container level read, write, list SAS. - :paramtype blob_reference_for_consumption: - ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto - :keyword pending_upload_id: ID for this upload request. - :paramtype pending_upload_id: str - :keyword pending_upload_type: TemporaryBlobReference is the only supported type. Possible - values include: "None", "TemporaryBlobReference". - :paramtype pending_upload_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadType - """ - super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = blob_reference_for_consumption - self.pending_upload_id = pending_upload_id - self.pending_upload_type = pending_upload_type - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = assigned_user - - -class PipelineJob(JobBaseProperties): - """Pipeline Job definition: defines generic to MFE attributes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jobs: Optional[Dict[str, Any]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - settings: Optional[Any] = None, - source_job_id: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword inputs: Inputs for the pipeline job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jobs: Jobs construct the Pipeline Job. - :paramtype jobs: dict[str, any] - :keyword outputs: Outputs for the pipeline job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :paramtype settings: any - :keyword source_job_id: ARM resource ID of source job. - :paramtype source_job_id: str - """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, parent_job_name=parent_job_name, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = inputs - self.jobs = jobs - self.outputs = outputs - self.settings = settings - self.source_job_id = source_job_id - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase): - """PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: Required. [Required] Specifies the type of signal to monitor.Constant filled - by server. Possible values include: "DataDrift", "PredictionDrift", "DataQuality", - "FeatureAttributionDrift", "Custom". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :ivar metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :ivar production_data: Required. [Required] The data which drift will be calculated for. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar reference_data: Required. [Required] The data to calculate drift against. - :vartype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'notification_types': {'key': 'notificationTypes', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["PredictionDriftMetricThresholdBase"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - notification_types: Optional[List[Union[str, "MonitoringNotificationType"]]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - **kwargs - ): - """ - :keyword notification_types: The current notification mode for this signal. - :paramtype notification_types: list[str or - ~azure.mgmt.machinelearningservices.models.MonitoringNotificationType] - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword feature_data_type_override: A dictionary that maps feature names to their respective - data types. - :paramtype feature_data_type_override: dict[str, str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureDataType] - :keyword metric_thresholds: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.PredictionDriftMetricThresholdBase] - :keyword production_data: Required. [Required] The data which drift will be calculated for. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword reference_data: Required. [Required] The data to calculate drift against. - :paramtype reference_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - """ - super(PredictionDriftMonitoringSignal, self).__init__(notification_types=notification_types, properties=properties, **kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.feature_data_type_override = feature_data_type_override - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar private_endpoint: The Private Endpoint resource. - :vartype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'WorkspacePrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - private_endpoint: Optional["WorkspacePrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[Union[str, "PrivateEndpointConnectionProvisioningState"]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword private_endpoint: The Private Endpoint resource. - :paramtype private_endpoint: - ~azure.mgmt.machinelearningservices.models.WorkspacePrivateEndpointResource - :keyword private_link_service_connection_state: The connection state. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :keyword provisioning_state: The current provisioning state. Possible values include: - "Succeeded", "Creating", "Deleting", "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateEndpointConnection"]] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateEndpointDestination(msrest.serialization.Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :vartype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - } - - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "RuleStatus"]] = None, - subresource_target: Optional[str] = None, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword subresource_target: - :paramtype subresource_target: str - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = service_resource_id - self.spark_enabled = spark_enabled - self.spark_status = spark_status - self.subresource_target = subresource_target - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :ivar fqdns: - :vartype fqdns: list[str] - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - 'fqdns': {'key': 'fqdns', 'type': '[str]'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - fqdns: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination - :keyword fqdns: - :paramtype fqdns: list[str] - """ - super(PrivateEndpointOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - self.fqdns = fqdns - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. - :paramtype subnet_arm_id: str - """ - super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = subnet_arm_id - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - group_id: Optional[str] = None, - required_members: Optional[List[str]] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword location: Same as workspace location. - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword required_members: The private link resource required member names. - :paramtype required_members: list[str] - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.sku = sku - self.tags = tags - self.group_id = group_id - self.required_members = required_members - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class ProbeSettings(msrest.serialization.Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - failure_threshold: Optional[int] = 30, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = "PT10S", - success_threshold: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "PT2S", - **kwargs - ): - """ - :keyword failure_threshold: The number of failures to allow before returning an unhealthy - status. - :paramtype failure_threshold: int - :keyword initial_delay: The delay before the first probe in ISO 8601 format. - :paramtype initial_delay: ~datetime.timedelta - :keyword period: The length of time between probes in ISO 8601 format. - :paramtype period: ~datetime.timedelta - :keyword success_threshold: The number of successful probes before returning a healthy status. - :paramtype success_threshold: int - :keyword timeout: The probe timeout in ISO 8601 format. - :paramtype timeout: ~datetime.timedelta - """ - super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = failure_threshold - self.initial_delay = initial_delay - self.period = period - self.success_threshold = success_threshold - self.timeout = timeout - - -class PromptSettings(msrest.serialization.Model): - """PromptSettings. - - :ivar enable_chain_of_density: - :vartype enable_chain_of_density: bool - :ivar enable_chain_of_thought: - :vartype enable_chain_of_thought: bool - :ivar max_len_summary: - :vartype max_len_summary: int - """ - - _attribute_map = { - 'enable_chain_of_density': {'key': 'enableChainOfDensity', 'type': 'bool'}, - 'enable_chain_of_thought': {'key': 'enableChainOfThought', 'type': 'bool'}, - 'max_len_summary': {'key': 'maxLenSummary', 'type': 'int'}, - } - - def __init__( - self, - *, - enable_chain_of_density: Optional[bool] = None, - enable_chain_of_thought: Optional[bool] = None, - max_len_summary: Optional[int] = None, - **kwargs - ): - """ - :keyword enable_chain_of_density: - :paramtype enable_chain_of_density: bool - :keyword enable_chain_of_thought: - :paramtype enable_chain_of_thought: bool - :keyword max_len_summary: - :paramtype max_len_summary: int - """ - super(PromptSettings, self).__init__(**kwargs) - self.enable_chain_of_density = enable_chain_of_density - self.enable_chain_of_thought = enable_chain_of_thought - self.max_len_summary = max_len_summary - - -class PTUDeploymentUsage(msrest.serialization.Model): - """PTUDeploymentUsage. - - :ivar collection_quota_usage: Usage number from the collection level quota. - :vartype collection_quota_usage: long - :ivar deployment_name: Deployment name. - :vartype deployment_name: str - :ivar resource_group: Resource group name. - :vartype resource_group: str - :ivar usage: Usage number from subscription level quota. - :vartype usage: long - :ivar workspace_name: Workspace name. - :vartype workspace_name: str - """ - - _attribute_map = { - 'collection_quota_usage': {'key': 'collectionQuotaUsage', 'type': 'long'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'usage': {'key': 'usage', 'type': 'long'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - } - - def __init__( - self, - *, - collection_quota_usage: Optional[int] = None, - deployment_name: Optional[str] = None, - resource_group: Optional[str] = None, - usage: Optional[int] = None, - workspace_name: Optional[str] = None, - **kwargs - ): - """ - :keyword collection_quota_usage: Usage number from the collection level quota. - :paramtype collection_quota_usage: long - :keyword deployment_name: Deployment name. - :paramtype deployment_name: str - :keyword resource_group: Resource group name. - :paramtype resource_group: str - :keyword usage: Usage number from subscription level quota. - :paramtype usage: long - :keyword workspace_name: Workspace name. - :paramtype workspace_name: str - """ - super(PTUDeploymentUsage, self).__init__(**kwargs) - self.collection_quota_usage = collection_quota_usage - self.deployment_name = deployment_name - self.resource_group = resource_group - self.usage = usage - self.workspace_name = workspace_name - - -class PyTorch(DistributionConfiguration): - """PyTorch distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, - } - - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs - ): - """ - :keyword process_count_per_instance: Number of processes per node. - :paramtype process_count_per_instance: int - """ - super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = process_count_per_instance - - -class QueueSettings(msrest.serialization.Model): - """QueueSettings. - - :ivar job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - } - - def __init__( - self, - *, - job_tier: Optional[Union[str, "JobTier"]] = None, - **kwargs - ): - """ - :keyword job_tier: Controls the compute job tier. Possible values include: "Null", "Spot", - "Basic", "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "QuotaUnit"]] = None, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = id - self.type = type - self.limit = limit - self.unit = unit - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["QuotaBaseProperties"]] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = value - self.location = location - - -class RaiBlocklistConfig(msrest.serialization.Model): - """Azure OpenAI blocklist config. - - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - """ - - _attribute_map = { - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'blocklist_name': {'key': 'blocklistName', 'type': 'str'}, - } - - def __init__( - self, - *, - blocking: Optional[bool] = None, - blocklist_name: Optional[str] = None, - **kwargs - ): - """ - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword blocklist_name: Name of ContentFilter. - :paramtype blocklist_name: str - """ - super(RaiBlocklistConfig, self).__init__(**kwargs) - self.blocking = blocking - self.blocklist_name = blocklist_name - - -class RaiBlocklistItemBulkRequest(msrest.serialization.Model): - """The Cognitive Services RaiBlocklist Item request body. - - :ivar name: - :vartype name: str - :ivar properties: Properties of Cognitive Services RaiBlocklist Item. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - properties: Optional["RaiBlocklistItemProperties"] = None, - **kwargs - ): - """ - :keyword name: - :paramtype name: str - :keyword properties: Properties of Cognitive Services RaiBlocklist Item. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemBulkRequest, self).__init__(**kwargs) - self.name = name - self.properties = properties - - -class RaiBlocklistItemProperties(msrest.serialization.Model): - """RAI Custom Blocklist Item properties. - - :ivar is_regex: If the pattern is a regex pattern. - :vartype is_regex: bool - :ivar pattern: Pattern to match against. - :vartype pattern: str - """ - - _attribute_map = { - 'is_regex': {'key': 'isRegex', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__( - self, - *, - is_regex: Optional[bool] = None, - pattern: Optional[str] = None, - **kwargs - ): - """ - :keyword is_regex: If the pattern is a regex pattern. - :paramtype is_regex: bool - :keyword pattern: Pattern to match against. - :paramtype pattern: str - """ - super(RaiBlocklistItemProperties, self).__init__(**kwargs) - self.is_regex = is_regex - self.pattern = pattern - - -class RaiBlocklistItemPropertiesBasicResource(Resource): - """RaiBlocklistItemPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist Item properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistItemProperties'}, - } - - def __init__( - self, - *, - properties: "RaiBlocklistItemProperties", - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist Item properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemProperties - """ - super(RaiBlocklistItemPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistItemPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiBlocklistItemPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - """ - super(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RaiBlocklistProperties(msrest.serialization.Model): - """RAI Custom Blocklist properties. - - :ivar description: Description of the block list. - :vartype description: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Description of the block list. - :paramtype description: str - """ - super(RaiBlocklistProperties, self).__init__(**kwargs) - self.description = description - - -class RaiBlocklistPropertiesBasicResource(Resource): - """RaiBlocklistPropertiesBasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. RAI Custom Blocklist properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiBlocklistProperties'}, - } - - def __init__( - self, - *, - properties: "RaiBlocklistProperties", - **kwargs - ): - """ - :keyword properties: Required. RAI Custom Blocklist properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiBlocklistProperties - """ - super(RaiBlocklistPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiBlocklistPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """RaiBlocklistPropertiesBasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiBlocklistPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiBlocklistPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - """ - super(RaiBlocklistPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RaiPolicyContentFilter(msrest.serialization.Model): - """Azure OpenAI Content Filter. - - :ivar allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :vartype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar enabled: If the ContentFilter is enabled. - :vartype enabled: bool - :ivar name: Name of ContentFilter. - :vartype name: str - :ivar source: Content source to apply the Content Filters. Possible values include: "Prompt", - "Completion". - :vartype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - - _attribute_map = { - 'allowed_content_level': {'key': 'allowedContentLevel', 'type': 'str'}, - 'blocking': {'key': 'blocking', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__( - self, - *, - allowed_content_level: Optional[Union[str, "AllowedContentLevel"]] = None, - blocking: Optional[bool] = None, - enabled: Optional[bool] = None, - name: Optional[str] = None, - source: Optional[Union[str, "RaiPolicyContentSource"]] = None, - **kwargs - ): - """ - :keyword allowed_content_level: Level at which content is filtered. Possible values include: - "Low", "Medium", "High". - :paramtype allowed_content_level: str or - ~azure.mgmt.machinelearningservices.models.AllowedContentLevel - :keyword blocking: If blocking would occur. - :paramtype blocking: bool - :keyword enabled: If the ContentFilter is enabled. - :paramtype enabled: bool - :keyword name: Name of ContentFilter. - :paramtype name: str - :keyword source: Content source to apply the Content Filters. Possible values include: - "Prompt", "Completion". - :paramtype source: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyContentSource - """ - super(RaiPolicyContentFilter, self).__init__(**kwargs) - self.allowed_content_level = allowed_content_level - self.blocking = blocking - self.enabled = enabled - self.name = name - self.source = source - - -class RaiPolicyProperties(msrest.serialization.Model): - """Azure OpenAI Content Filters properties. - - :ivar base_policy_name: Name of the base Content Filters. - :vartype base_policy_name: str - :ivar completion_blocklists: - :vartype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar content_filters: - :vartype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :ivar mode: Content Filters mode. Possible values include: "Default", "Deferred", "Blocking". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :ivar prompt_blocklists: - :vartype prompt_blocklists: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :ivar type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - - _attribute_map = { - 'base_policy_name': {'key': 'basePolicyName', 'type': 'str'}, - 'completion_blocklists': {'key': 'completionBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'content_filters': {'key': 'contentFilters', 'type': '[RaiPolicyContentFilter]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'prompt_blocklists': {'key': 'promptBlocklists', 'type': '[RaiBlocklistConfig]'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - base_policy_name: Optional[str] = None, - completion_blocklists: Optional[List["RaiBlocklistConfig"]] = None, - content_filters: Optional[List["RaiPolicyContentFilter"]] = None, - mode: Optional[Union[str, "RaiPolicyMode"]] = None, - prompt_blocklists: Optional[List["RaiBlocklistConfig"]] = None, - type: Optional[Union[str, "RaiPolicyType"]] = None, - **kwargs - ): - """ - :keyword base_policy_name: Name of the base Content Filters. - :paramtype base_policy_name: str - :keyword completion_blocklists: - :paramtype completion_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword content_filters: - :paramtype content_filters: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyContentFilter] - :keyword mode: Content Filters mode. Possible values include: "Default", "Deferred", - "Blocking". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyMode - :keyword prompt_blocklists: - :paramtype prompt_blocklists: - list[~azure.mgmt.machinelearningservices.models.RaiBlocklistConfig] - :keyword type: Content Filters policy type. Possible values include: "UserManaged", - "SystemManaged". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.RaiPolicyType - """ - super(RaiPolicyProperties, self).__init__(**kwargs) - self.base_policy_name = base_policy_name - self.completion_blocklists = completion_blocklists - self.content_filters = content_filters - self.mode = mode - self.prompt_blocklists = prompt_blocklists - self.type = type - - -class RaiPolicyPropertiesBasicResource(Resource): - """Azure OpenAI Content Filters resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. Azure OpenAI Content Filters properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'RaiPolicyProperties'}, - } - - def __init__( - self, - *, - properties: "RaiPolicyProperties", - **kwargs - ): - """ - :keyword properties: Required. Azure OpenAI Content Filters properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.RaiPolicyProperties - """ - super(RaiPolicyPropertiesBasicResource, self).__init__(**kwargs) - self.properties = properties - - -class RaiPolicyPropertiesBasicResourceArmPaginatedResult(msrest.serialization.Model): - """Azure OpenAI Content Filters resource list. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[RaiPolicyPropertiesBasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["RaiPolicyPropertiesBasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - """ - super(RaiPolicyPropertiesBasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class RandomSamplingAlgorithm(SamplingAlgorithm): - """Defines a Sampling Algorithm that generates values randomly. - - All required parameters must be populated in order to send to Azure. - - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - :ivar rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". - :vartype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - """ - - _validation = { - 'sampling_algorithm_type': {'required': True}, - } - - _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword rule: The specific type of random algorithm. Possible values include: "Random", - "Sobol". - :paramtype rule: str or ~azure.mgmt.machinelearningservices.models.RandomSamplingAlgorithmRule - :keyword seed: An optional integer to use as the seed for random number generation. - :paramtype seed: int - """ - super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = rule - self.seed = seed - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ComputeRecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Optional[Union[str, "ComputeRecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["ComputeRecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: - "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or - ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceFrequency - :keyword interval: [Required] Specifies schedule interval in conjunction with frequency. - :paramtype interval: int - :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword schedule: [Required] The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.ComputeRecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = frequency - self.interval = interval - self.start_time = start_time - self.time_zone = time_zone - self.schedule = schedule - - -class RecurrenceSchedule(msrest.serialization.Model): - """RecurrenceSchedule. - - All required parameters must be populated in order to send to Azure. - - :ivar hours: Required. [Required] List of hours for the schedule. - :vartype hours: list[int] - :ivar minutes: Required. [Required] List of minutes for the schedule. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - - _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, - } - - _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - hours: List[int], - minutes: List[int], - month_days: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "WeekDay"]]] = None, - **kwargs - ): - """ - :keyword hours: Required. [Required] List of hours for the schedule. - :paramtype hours: list[int] - :keyword minutes: Required. [Required] List of minutes for the schedule. - :paramtype minutes: list[int] - :keyword month_days: List of month days for the schedule. - :paramtype month_days: list[int] - :keyword week_days: List of days for the schedule. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = hours - self.minutes = minutes - self.month_days = month_days - self.week_days = week_days - - -class RecurrenceTrigger(TriggerBase): - """RecurrenceTrigger. - - All required parameters must be populated in order to send to Azure. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :vartype time_zone: str - :ivar trigger_type: Required. [Required].Constant filled by server. Possible values include: - "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: Required. [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, - } - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Union[str, "RecurrenceFrequency"], - interval: int, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = "UTC", - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - https://en.wikipedia.org/wiki/ISO_8601. - Recommented format would be "2022-06-01T00:00:01" - If not present, the schedule will run indefinitely. - :paramtype end_time: str - :keyword start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :paramtype start_time: str - :keyword time_zone: Specifies time zone in which the schedule runs. - TimeZone should follow Windows time zone format. Refer: - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. - :paramtype time_zone: str - :keyword frequency: Required. [Required] The frequency to trigger schedule. Possible values - include: "Minute", "Hour", "Day", "Week", "Month". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: Required. [Required] Specifies schedule interval in conjunction with - frequency. - :paramtype interval: int - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = frequency - self.interval = interval - self.schedule = schedule - - -class RegenerateEndpointKeysRequest(msrest.serialization.Model): - """RegenerateEndpointKeysRequest. - - All required parameters must be populated in order to send to Azure. - - :ivar key_type: Required. [Required] Specification for which type of key to generate. Primary - or Secondary. Possible values include: "Primary", "Secondary". - :vartype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, - } - - def __init__( - self, - *, - key_type: Union[str, "KeyType"], - key_value: Optional[str] = None, - **kwargs - ): - """ - :keyword key_type: Required. [Required] Specification for which type of key to generate. - Primary or Secondary. Possible values include: "Primary", "Secondary". - :paramtype key_type: str or ~azure.mgmt.machinelearningservices.models.KeyType - :keyword key_value: The value the key is set to. - :paramtype key_value: str - """ - super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = key_type - self.key_value = key_value - - -class RegenerateServiceAccountKeyContent(msrest.serialization.Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Possible values include: "Key1", "Key2". - :vartype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__( - self, - *, - key_name: Optional[Union[str, "ServiceAccountKeyName"]] = None, - **kwargs - ): - """ - :keyword key_name: Possible values include: "Key1", "Key2". - :paramtype key_name: str or ~azure.mgmt.machinelearningservices.models.ServiceAccountKeyName - """ - super(RegenerateServiceAccountKeyContent, self).__init__(**kwargs) - self.key_name = key_name - - -class Registry(TrackedResource): - """Registry. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'managed_resource_group_settings': {'key': 'properties.managedResourceGroupSettings', 'type': 'ManagedResourceGroupSettings'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'registry_private_endpoint_connections': {'key': 'properties.registryPrivateEndpointConnections', 'type': '[RegistryPrivateEndpointConnection]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - managed_resource_group_settings: Optional["ManagedResourceGroupSettings"] = None, - ml_flow_registry_uri: Optional[str] = None, - registry_private_endpoint_connections: Optional[List["RegistryPrivateEndpointConnection"]] = None, - public_network_access: Optional[str] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword discovery_url: Discovery URL for the Registry. - :paramtype discovery_url: str - :keyword intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: ResourceId of the managed RG if the registry has system - created resources. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword managed_resource_group_settings: Managed resource group specific settings. - :paramtype managed_resource_group_settings: - ~azure.mgmt.machinelearningservices.models.ManagedResourceGroupSettings - :keyword ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :paramtype ml_flow_registry_uri: str - :keyword registry_private_endpoint_connections: Private endpoint connections info used for - pending connections in private link portal. - :paramtype registry_private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.RegistryPrivateEndpointConnection] - :keyword public_network_access: Is the Registry accessible from the internet? - Possible values: "Enabled" or "Disabled". - :paramtype public_network_access: str - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.sku = sku - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.managed_resource_group_settings = managed_resource_group_settings - self.ml_flow_registry_uri = ml_flow_registry_uri - self.registry_private_endpoint_connections = registry_private_endpoint_connections - self.public_network_access = public_network_access - self.region_details = region_details - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.passwords = passwords - self.username = None - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(RegistryPartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) - - -class RegistryPrivateEndpointConnection(msrest.serialization.Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'registry_private_link_service_connection_state': {'key': 'properties.registryPrivateLinkServiceConnectionState', 'type': 'RegistryPrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - group_ids: Optional[List[str]] = None, - private_endpoint: Optional["PrivateEndpointResource"] = None, - registry_private_link_service_connection_state: Optional["RegistryPrivateLinkServiceConnectionState"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - """ - :keyword id: This is the private endpoint connection name created on SRP - Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :paramtype id: str - :keyword location: Same as workspace location. - :paramtype location: str - :keyword group_ids: The group ids. - :paramtype group_ids: list[str] - :keyword private_endpoint: The PE network resource that is linked to this PE connection. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpointResource - :keyword registry_private_link_service_connection_state: The connection state. - :paramtype registry_private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.RegistryPrivateLinkServiceConnectionState - :keyword provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :paramtype provisioning_state: str - """ - super(RegistryPrivateEndpointConnection, self).__init__(**kwargs) - self.id = id - self.location = location - self.group_ids = group_ids - self.private_endpoint = private_endpoint - self.registry_private_link_service_connection_state = registry_private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class RegistryPrivateLinkServiceConnectionState(msrest.serialization.Model): - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. - :paramtype actions_required: str - :keyword description: User-defined message that, per NRP doc, may be used for approval-related - message. - :paramtype description: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(RegistryPrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.actions_required = actions_required - self.description = description - self.status = status - - -class RegistryRegionArmDetails(msrest.serialization.Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - - _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, - } - - def __init__( - self, - *, - acr_details: Optional[List["AcrDetails"]] = None, - location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, - **kwargs - ): - """ - :keyword acr_details: List of ACR accounts. - :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] - :keyword location: The location where the registry exists. - :paramtype location: str - :keyword storage_account_details: List of storage accounts. - :paramtype storage_account_details: - list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] - """ - super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = acr_details - self.location = location - self.storage_account_details = storage_account_details - - -class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Registry entities. - - :ivar next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Registry. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Registry"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Registry objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Registry. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] - """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class Regression(AutoMLVertical, TableVertical): - """Regression task in AutoML Table vertical. - - All required parameters must be populated in order to send to Azure. - - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - test_data: Optional["MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, - training_settings: Optional["RegressionTrainingSettings"] = None, - **kwargs - ): - """ - :keyword cv_split_column_names: Columns to use for CVSplit data. - :paramtype cv_split_column_names: list[str] - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: - ~azure.mgmt.machinelearningservices.models.TableVerticalLimitSettings - :keyword n_cross_validations: Number of cross validation folds to be applied on training - dataset - when validation dataset is not provided. - :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations - :keyword test_data: Test data input. - :paramtype test_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype test_data_size: float - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :paramtype validation_data_size: float - :keyword weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :paramtype weight_column_name: str - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for regression task. Possible values include: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", - "NormalizedMeanAbsoluteError". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics - :keyword training_settings: Inputs for training phase for an AutoML Job. - :paramtype training_settings: - ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings - """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) - self.cv_split_column_names = cv_split_column_names - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.test_data = test_data - self.test_data_size = test_data_size - self.validation_data = validation_data - self.validation_data_size = validation_data_size - self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str - self.primary_metric = primary_metric - self.training_settings = training_settings - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - - _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = False, - enable_model_explainability: Optional[bool] = True, - enable_onnx_compatible_models: Optional[bool] = False, - enable_stack_ensemble: Optional[bool] = True, - enable_vote_ensemble: Optional[bool] = True, - ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", - stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - **kwargs - ): - """ - :keyword enable_dnn_training: Enable recommendation of DNN models. - :paramtype enable_dnn_training: bool - :keyword enable_model_explainability: Flag to turn on explainability on best model. - :paramtype enable_model_explainability: bool - :keyword enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :paramtype enable_onnx_compatible_models: bool - :keyword enable_stack_ensemble: Enable stack ensemble run. - :paramtype enable_stack_ensemble: bool - :keyword enable_vote_ensemble: Enable voting ensemble run. - :paramtype enable_vote_ensemble: bool - :keyword ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. - Configure this parameter with a higher value than 300 secs, if more time is needed. - :paramtype ensemble_model_download_timeout: ~datetime.timedelta - :keyword stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :paramtype stack_ensemble_settings: - ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings - :keyword allowed_training_algorithms: Allowed models for regression task. - :paramtype allowed_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - :keyword blocked_training_algorithms: Blocked models for regression task. - :paramtype blocked_training_algorithms: list[str or - ~azure.mgmt.machinelearningservices.models.RegressionModels] - """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -class RequestConfiguration(msrest.serialization.Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = 1, - request_timeout: Optional[datetime.timedelta] = "PT5S", - **kwargs - ): - """ - :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per - node allowed per deployment. Defaults to 1. - :paramtype max_concurrent_requests_per_instance: int - :keyword request_timeout: The scoring timeout in ISO 8601 format. - Defaults to 5000ms. - :paramtype request_timeout: ~datetime.timedelta - """ - super(RequestConfiguration, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance - self.request_timeout = request_timeout - - -class RequestLogging(msrest.serialization.Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, - } - - def __init__( - self, - *, - capture_headers: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :paramtype capture_headers: list[str] - """ - super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = capture_headers - - -class ResizeSchema(msrest.serialization.Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - _attribute_map = { - 'target_vm_size': {'key': 'targetVMSize', 'type': 'str'}, - } - - def __init__( - self, - *, - target_vm_size: Optional[str] = None, - **kwargs - ): - """ - :keyword target_vm_size: The name of the virtual machine size. - :paramtype target_vm_size: str - """ - super(ResizeSchema, self).__init__(**kwargs) - self.target_vm_size = target_vm_size - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = id - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class RollingInputData(MonitoringInputDataBase): - """Rolling input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: Required. [Required] The size of the rolling data window. - :vartype window_size: ~datetime.timedelta - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_offset': {'required': True}, - 'window_size': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_offset': {'key': 'windowOffset', 'type': 'duration'}, - 'window_size': {'key': 'windowSize', 'type': 'duration'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_offset: datetime.timedelta, - window_size: datetime.timedelta, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_offset: Required. [Required] The time offset between the end of the data window - and the monitor's current run time. - :paramtype window_offset: ~datetime.timedelta - :keyword window_size: Required. [Required] The size of the rolling data window. - :paramtype window_size: ~datetime.timedelta - """ - super(RollingInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Rolling' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_offset = window_offset - self.window_size = window_size - - -class Route(msrest.serialization.Model): - """Route. - - All required parameters must be populated in order to send to Azure. - - :ivar path: Required. [Required] The path for the route. - :vartype path: str - :ivar port: Required. [Required] The port for the route. - :vartype port: int - """ - - _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, - } - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): - """ - :keyword path: Required. [Required] The path for the route. - :paramtype path: str - :keyword port: Required. [Required] The port for the route. - :paramtype port: int - """ - super(Route, self).__init__(**kwargs) - self.path = path - self.port = port - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -class SASCredential(DataReferenceCredential): - """Access with full SAS uri. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS", "DockerCredentials", - "ManagedIdentity", "NoCredentials". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredential, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SASCredentialDto(PendingUploadCredentialDto): - """SASCredentialDto. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "SAS". - :vartype credential_type: str or - ~azure.mgmt.machinelearningservices.models.PendingUploadCredentialType - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :paramtype sas_uri: str - """ - super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = sas_uri - - -class SasDatastoreCredentials(DatastoreCredentials): - """SAS datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar secrets: Required. [Required] Storage container secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - - _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, - } - - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): - """ - :keyword secrets: Required. [Required] Storage container secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets - """ - super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = secrets - - -class SasDatastoreSecrets(DatastoreSecrets): - """Datastore SAS secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): - """ - :keyword sas_token: Storage container SAS token. - :paramtype sas_token: str - """ - super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = sas_token - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = 0, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = max_node_count - self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = scale_settings - - -class ScaleUnitConfiguration(msrest.serialization.Model): - """Configuration for ScaleUnit pool. - - :ivar disable_public_egress: Gets or sets a value indicating whether PublicEgress is disabled. - :vartype disable_public_egress: bool - :ivar registries: Gets or sets a list of Registry sources that will be used to confirm - identity, storage, ACR. - :vartype registries: list[str] - """ - - _attribute_map = { - 'disable_public_egress': {'key': 'disablePublicEgress', 'type': 'bool'}, - 'registries': {'key': 'registries', 'type': '[str]'}, - } - - def __init__( - self, - *, - disable_public_egress: Optional[bool] = False, - registries: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword disable_public_egress: Gets or sets a value indicating whether PublicEgress is - disabled. - :paramtype disable_public_egress: bool - :keyword registries: Gets or sets a list of Registry sources that will be used to confirm - identity, storage, ACR. - :paramtype registries: list[str] - """ - super(ScaleUnitConfiguration, self).__init__(**kwargs) - self.disable_public_egress = disable_public_egress - self.registries = registries - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, - } - - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties - """ - super(Schedule, self).__init__(**kwargs) - self.properties = properties - - -class ScheduleBase(msrest.serialization.Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, - status: Optional[Union[str, "ScheduleStatus"]] = None, - **kwargs - ): - """ - :keyword id: A system assigned id for the schedule. - :paramtype id: str - :keyword provisioning_status: The current deployment state of schedule. Possible values - include: "Completed", "Provisioning", "Failed". - :paramtype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningState - :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", - "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - """ - super(ScheduleBase, self).__init__(**kwargs) - self.id = id - self.provisioning_status = provisioning_status - self.status = status - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: Required. [Required] Specifies the action of the schedule. - :vartype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Possible values include: - "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ScheduleProvisioningStatus - :ivar trigger: Required. [Required] Specifies the trigger details. - :vartype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - - _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, - } - - def __init__( - self, - *, - action: "ScheduleActionBase", - trigger: "TriggerBase", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - display_name: Optional[str] = None, - is_enabled: Optional[bool] = True, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword action: Required. [Required] Specifies the action of the schedule. - :paramtype action: ~azure.mgmt.machinelearningservices.models.ScheduleActionBase - :keyword display_name: Display name of schedule. - :paramtype display_name: str - :keyword is_enabled: Is the schedule enabled?. - :paramtype is_enabled: bool - :keyword trigger: Required. [Required] Specifies the trigger details. - :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase - """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.action = action - self.display_name = display_name - self.is_enabled = is_enabled - self.provisioning_state = None - self.trigger = trigger - - -class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of Schedule entities. - - :ivar next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type Schedule. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Schedule"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of Schedule objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type Schedule. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] - """ - super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = script_source - self.script_data = script_data - self.script_arguments = script_arguments - self.timeout = timeout - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - *, - startup_script: Optional["ScriptReference"] = None, - creation_script: Optional["ScriptReference"] = None, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = startup_script - self.creation_script = creation_script - - -class SecretExpiry(msrest.serialization.Model): - """Secret expiration configuration. - - :ivar expirable_secret: Indicates if the secret is expirable. - :vartype expirable_secret: bool - :ivar expire_after_hours: Number of hours after which the secret will expire. - :vartype expire_after_hours: int - """ - - _attribute_map = { - 'expirable_secret': {'key': 'expirableSecret', 'type': 'bool'}, - 'expire_after_hours': {'key': 'expireAfterHours', 'type': 'int'}, - } - - def __init__( - self, - *, - expirable_secret: Optional[bool] = False, - expire_after_hours: Optional[int] = 1, - **kwargs - ): - """ - :keyword expirable_secret: Indicates if the secret is expirable. - :paramtype expirable_secret: bool - :keyword expire_after_hours: Number of hours after which the secret will expire. - :paramtype expire_after_hours: int - """ - super(SecretExpiry, self).__init__(**kwargs) - self.expirable_secret = expirable_secret - self.expire_after_hours = expire_after_hours - - -class ServerlessComputeSettings(msrest.serialization.Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - _attribute_map = { - 'serverless_compute_custom_subnet': {'key': 'serverlessComputeCustomSubnet', 'type': 'str'}, - 'serverless_compute_no_public_ip': {'key': 'serverlessComputeNoPublicIP', 'type': 'bool'}, - } - - def __init__( - self, - *, - serverless_compute_custom_subnet: Optional[str] = None, - serverless_compute_no_public_ip: Optional[bool] = None, - **kwargs - ): - """ - :keyword serverless_compute_custom_subnet: The resource ID of an existing virtual network - subnet in which serverless compute nodes should be deployed. - :paramtype serverless_compute_custom_subnet: str - :keyword serverless_compute_no_public_ip: The flag to signal if serverless compute nodes - deployed in custom vNet would have no public IP addresses for a workspace with private - endpoint. - :paramtype serverless_compute_no_public_ip: bool - """ - super(ServerlessComputeSettings, self).__init__(**kwargs) - self.serverless_compute_custom_subnet = serverless_compute_custom_subnet - self.serverless_compute_no_public_ip = serverless_compute_no_public_ip - - -class ServerlessEndpoint(TrackedResource): - """ServerlessEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ServerlessEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "ServerlessEndpointProperties", - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :paramtype kind: str - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ServerlessEndpointProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ServerlessEndpoint, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -class ServerlessEndpointCapacityReservation(msrest.serialization.Model): - """ServerlessEndpointCapacityReservation. - - All required parameters must be populated in order to send to Azure. - - :ivar capacity_reservation_group_id: Required. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: - :vartype endpoint_reserved_capacity: int - """ - - _validation = { - 'capacity_reservation_group_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'capacity_reservation_group_id': {'key': 'capacityReservationGroupId', 'type': 'str'}, - 'endpoint_reserved_capacity': {'key': 'endpointReservedCapacity', 'type': 'int'}, - } - - def __init__( - self, - *, - capacity_reservation_group_id: str, - endpoint_reserved_capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword capacity_reservation_group_id: Required. - :paramtype capacity_reservation_group_id: str - :keyword endpoint_reserved_capacity: - :paramtype endpoint_reserved_capacity: int - """ - super(ServerlessEndpointCapacityReservation, self).__init__(**kwargs) - self.capacity_reservation_group_id = capacity_reservation_group_id - self.endpoint_reserved_capacity = endpoint_reserved_capacity - - -class ServerlessEndpointContentSafety(msrest.serialization.Model): - """ServerlessEndpointContentSafety. - - All required parameters must be populated in order to send to Azure. - - :ivar content_safety_status: Required. Specifies the status of content safety. Possible values - include: "Enabled", "Disabled". - :vartype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - - _validation = { - 'content_safety_status': {'required': True}, - } - - _attribute_map = { - 'content_safety_status': {'key': 'contentSafetyStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - content_safety_status: Union[str, "ContentSafetyStatus"], - **kwargs - ): - """ - :keyword content_safety_status: Required. Specifies the status of content safety. Possible - values include: "Enabled", "Disabled". - :paramtype content_safety_status: str or - ~azure.mgmt.machinelearningservices.models.ContentSafetyStatus - """ - super(ServerlessEndpointContentSafety, self).__init__(**kwargs) - self.content_safety_status = content_safety_status - - -class ServerlessEndpointInferenceEndpoint(msrest.serialization.Model): - """ServerlessEndpointInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Dictionary of :code:``. - :vartype headers: dict[str, str] - :ivar uri: Required. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - **kwargs - ): - """ - :keyword uri: Required. - :paramtype uri: str - """ - super(ServerlessEndpointInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = uri - - -class ServerlessEndpointModelSettings(msrest.serialization.Model): - """ServerlessEndpointModelSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar model_id: Required. - :vartype model_id: str - """ - - _validation = { - 'model_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - } - - def __init__( - self, - *, - model_id: str, - **kwargs - ): - """ - :keyword model_id: Required. - :paramtype model_id: str - """ - super(ServerlessEndpointModelSettings, self).__init__(**kwargs) - self.model_id = model_id - - -class ServerlessEndpointProperties(msrest.serialization.Model): - """ServerlessEndpointProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key", "AAD", "KeyAndAAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :vartype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :ivar endpoint_state: The current state of the ServerlessEndpoint. Possible values include: - "Unknown", "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", - "CreationFailed", "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription Azure ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - :ivar provisioning_state: Provisioning state for the endpoint. Possible values include: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.EndpointProvisioningState - """ - - _validation = { - 'auth_mode': {'required': True}, - 'endpoint_state': {'readonly': True}, - 'inference_endpoint': {'readonly': True}, - 'marketplace_subscription_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ModelSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_mode: Union[str, "ServerlessInferenceEndpointAuthMode"], - content_safety: Optional["ContentSafety"] = None, - model_settings: Optional["ModelSettings"] = None, - **kwargs - ): - """ - :keyword auth_mode: Required. [Required] Specifies the authentication mode for the Serverless - endpoint. Possible values include: "Key", "AAD", "KeyAndAAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :paramtype content_safety: ~azure.mgmt.machinelearningservices.models.ContentSafety - :keyword model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :paramtype model_settings: ~azure.mgmt.machinelearningservices.models.ModelSettings - """ - super(ServerlessEndpointProperties, self).__init__(**kwargs) - self.auth_mode = auth_mode - self.content_safety = content_safety - self.endpoint_state = None - self.inference_endpoint = None - self.marketplace_subscription_id = None - self.model_settings = model_settings - self.provisioning_state = None - - -class ServerlessEndpointResourceProperties(EndpointResourceProperties): - """ServerlessEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Possible values include: "Key", "AAD", "KeyAndAAD". - :vartype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: - :vartype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :ivar content_safety: - :vartype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :ivar endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :vartype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :ivar inference_endpoint: - :vartype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :ivar marketplace_subscription_id: - :vartype marketplace_subscription_id: str - :ivar metadata: Anything. - :vartype metadata: any - :ivar model_settings: - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :ivar offer: - :vartype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'capacity_reservation': {'key': 'capacityReservation', 'type': 'ServerlessEndpointCapacityReservation'}, - 'content_safety': {'key': 'contentSafety', 'type': 'ServerlessEndpointContentSafety'}, - 'endpoint_state': {'key': 'endpointState', 'type': 'str'}, - 'inference_endpoint': {'key': 'inferenceEndpoint', 'type': 'ServerlessEndpointInferenceEndpoint'}, - 'marketplace_subscription_id': {'key': 'marketplaceSubscriptionId', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ServerlessEndpointModelSettings'}, - 'offer': {'key': 'offer', 'type': 'ServerlessOffer'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - auth_mode: Optional[Union[str, "ServerlessInferenceEndpointAuthMode"]] = None, - capacity_reservation: Optional["ServerlessEndpointCapacityReservation"] = None, - content_safety: Optional["ServerlessEndpointContentSafety"] = None, - endpoint_state: Optional[Union[str, "ServerlessEndpointState"]] = None, - inference_endpoint: Optional["ServerlessEndpointInferenceEndpoint"] = None, - marketplace_subscription_id: Optional[str] = None, - metadata: Optional[Any] = None, - model_settings: Optional["ServerlessEndpointModelSettings"] = None, - offer: Optional["ServerlessOffer"] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - :keyword auth_mode: Possible values include: "Key", "AAD", "KeyAndAAD". - :paramtype auth_mode: str or - ~azure.mgmt.machinelearningservices.models.ServerlessInferenceEndpointAuthMode - :keyword capacity_reservation: - :paramtype capacity_reservation: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointCapacityReservation - :keyword content_safety: - :paramtype content_safety: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointContentSafety - :keyword endpoint_state: State of the Serverless Endpoint. Possible values include: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - "DeletionFailed". - :paramtype endpoint_state: str or - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointState - :keyword inference_endpoint: - :paramtype inference_endpoint: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointInferenceEndpoint - :keyword marketplace_subscription_id: - :paramtype marketplace_subscription_id: str - :keyword metadata: Anything. - :paramtype metadata: any - :keyword model_settings: - :paramtype model_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessEndpointModelSettings - :keyword offer: - :paramtype offer: ~azure.mgmt.machinelearningservices.models.ServerlessOffer - """ - super(ServerlessEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'serverlessEndpoint' # type: str - self.auth_mode = auth_mode - self.capacity_reservation = capacity_reservation - self.content_safety = content_safety - self.endpoint_state = endpoint_state - self.inference_endpoint = inference_endpoint - self.marketplace_subscription_id = marketplace_subscription_id - self.metadata = metadata - self.model_settings = model_settings - self.offer = offer - - -class ServerlessEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of ServerlessEndpoint entities. - - :ivar next_link: The link to the next page of ServerlessEndpoint objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type ServerlessEndpoint. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ServerlessEndpoint]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["ServerlessEndpoint"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of ServerlessEndpoint objects. If null, there are - no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type ServerlessEndpoint. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - """ - super(ServerlessEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class ServerlessInferenceEndpoint(msrest.serialization.Model): - """ServerlessInferenceEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :vartype uri: str - """ - - _validation = { - 'headers': {'readonly': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'headers': {'key': 'headers', 'type': '{str}'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - **kwargs - ): - """ - :keyword uri: Required. [Required] The inference uri to target when making requests against the - Serverless Endpoint. - :paramtype uri: str - """ - super(ServerlessInferenceEndpoint, self).__init__(**kwargs) - self.headers = None - self.uri = uri - - -class ServerlessOffer(msrest.serialization.Model): - """ServerlessOffer. - - All required parameters must be populated in order to send to Azure. - - :ivar offer_name: Required. - :vartype offer_name: str - :ivar publisher: Required. - :vartype publisher: str - """ - - _validation = { - 'offer_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - offer_name: str, - publisher: str, - **kwargs - ): - """ - :keyword offer_name: Required. - :paramtype offer_name: str - :keyword publisher: Required. - :paramtype publisher: str - """ - super(ServerlessOffer, self).__init__(**kwargs) - self.offer_name = offer_name - self.publisher = publisher - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs - ): - """ - :keyword cosmos_db: - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = cosmos_db - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = credentials - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials): - """Service Principal datastore credentials configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar credentials_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", - "None", "Sas", "ServicePrincipal". - :vartype credentials_type: str or ~azure.mgmt.machinelearningservices.models.CredentialsType - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: Required. [Required] Service principal client ID. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: Required. [Required] Service principal secrets. - :vartype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: Required. [Required] ID of the tenant to which the service principal belongs. - :vartype tenant_id: str - """ - - _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - secrets: "ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - **kwargs - ): - """ - :keyword authority_url: Authority URL used for authentication. - :paramtype authority_url: str - :keyword client_id: Required. [Required] Service principal client ID. - :paramtype client_id: str - :keyword resource_url: Resource the service principal has access to. - :paramtype resource_url: str - :keyword secrets: Required. [Required] Service principal secrets. - :paramtype secrets: ~azure.mgmt.machinelearningservices.models.ServicePrincipalDatastoreSecrets - :keyword tenant_id: Required. [Required] ID of the tenant to which the service principal - belongs. - :paramtype tenant_id: str - """ - super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = authority_url - self.client_id = client_id - self.resource_url = resource_url - self.secrets = secrets - self.tenant_id = tenant_id - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets): - """Datastore Service Principal secrets. - - All required parameters must be populated in order to send to Azure. - - :ivar secrets_type: Required. [Required] Credential type used to authentication with - storage.Constant filled by server. Possible values include: "AccountKey", "Certificate", "Sas", - "ServicePrincipal". - :vartype secrets_type: str or ~azure.mgmt.machinelearningservices.models.SecretsType - :ivar client_secret: Service principal secret. - :vartype client_secret: str - """ - - _validation = { - 'secrets_type': {'required': True}, - } - - _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): - """ - :keyword client_secret: Service principal secret. - :paramtype client_secret: str - """ - super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = client_secret - - -class ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - } - - def __init__( - self, - *, - action: Optional[Union[str, "RuleAction"]] = None, - address_prefixes: Optional[List[str]] = None, - port_ranges: Optional[str] = None, - protocol: Optional[str] = None, - service_tag: Optional[str] = None, - **kwargs - ): - """ - :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction - :keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :paramtype address_prefixes: list[str] - :keyword port_ranges: - :paramtype port_ranges: str - :keyword protocol: - :paramtype protocol: str - :keyword service_tag: - :paramtype service_tag: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.action = action - self.address_prefixes = address_prefixes - self.port_ranges = port_ranges - self.protocol = protocol - self.service_tag = service_tag - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Possible - values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :ivar type: Required. Type of a managed network Outbound Rule of a machine learning - workspace.Constant filled by server. Possible values include: "FQDN", "PrivateEndpoint", - "ServiceTag". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.RuleType - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - - _validation = { - 'parent_rule_names': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'parent_rule_names': {'key': 'parentRuleNames', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["ServiceTagDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined", "Dependency". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword status: Type of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Inactive", "Active". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus - :keyword destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination - """ - super(ServiceTagOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'ServiceTag' # type: str - self.destination = destination - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = scripts - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - group_id: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "EndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword group_id: group id of the private link. - :paramtype group_id: str - :keyword private_link_resource_id: the resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Connection status of the service consumer with the service provider. Possible - values include: "Approved", "Pending", "Rejected", "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = name - self.group_id = group_id - self.private_link_resource_id = private_link_resource_id - self.request_message = request_message - self.status = status - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - """ - :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SkuCapacity(msrest.serialization.Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - } - - def __init__( - self, - *, - default: Optional[int] = 0, - maximum: Optional[int] = 0, - minimum: Optional[int] = 0, - scale_type: Optional[Union[str, "SkuScaleType"]] = None, - **kwargs - ): - """ - :keyword default: Gets or sets the default capacity. - :paramtype default: int - :keyword maximum: Gets or sets the maximum. - :paramtype maximum: int - :keyword minimum: Gets or sets the minimum. - :paramtype minimum: int - :keyword scale_type: Gets or sets the type of the scale. Possible values include: "Automatic", - "Manual", "None". - :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType - """ - super(SkuCapacity, self).__init__(**kwargs) - self.default = default - self.maximum = maximum - self.minimum = minimum - self.scale_type = scale_type - - -class SkuResource(msrest.serialization.Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - - _validation = { - 'resource_type': {'readonly': True}, - } - - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, - } - - def __init__( - self, - *, - capacity: Optional["SkuCapacity"] = None, - sku: Optional["SkuSetting"] = None, - **kwargs - ): - """ - :keyword capacity: Gets or sets the Sku Capacity. - :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity - :keyword sku: Gets or sets the Sku. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting - """ - super(SkuResource, self).__init__(**kwargs) - self.capacity = capacity - self.resource_type = None - self.sku = sku - - -class SkuResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of SkuResource entities. - - :ivar next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type SkuResource. - :vartype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["SkuResource"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of SkuResource objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type SkuResource. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] - """ - super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class SkuSetting(msrest.serialization.Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number - code. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :vartype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - """ - :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a - letter+number code. - :paramtype name: str - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier - """ - super(SkuSetting, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class SparkJob(JobBaseProperties): - """Spark job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: Required. [Required] arm-id of the code asset. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: Required. [Required] The entry to execute on startup of the job. - :vartype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - *, - code_id: str, - entry: "SparkJobEntry", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - archives: Optional[List[str]] = None, - args: Optional[str] = None, - conf: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[Dict[str, str]] = None, - files: Optional[List[str]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - jars: Optional[List[str]] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - py_files: Optional[List[str]] = None, - queue_settings: Optional["QueueSettings"] = None, - resources: Optional["SparkResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword archives: Archive files used in the job. - :paramtype archives: list[str] - :keyword args: Arguments for the job. - :paramtype args: str - :keyword code_id: Required. [Required] arm-id of the code asset. - :paramtype code_id: str - :keyword conf: Spark configured properties. - :paramtype conf: dict[str, str] - :keyword entry: Required. [Required] The entry to execute on startup of the job. - :paramtype entry: ~azure.mgmt.machinelearningservices.models.SparkJobEntry - :keyword environment_id: The ARM resource ID of the Environment specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword files: Files used in the job. - :paramtype files: list[str] - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword jars: Jar files used in the job. - :paramtype jars: list[str] - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword py_files: Python files used in the job. - :paramtype py_files: list[str] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration - """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, parent_job_name=parent_job_name, services=services, **kwargs) - self.job_type = 'Spark' # type: str - self.archives = archives - self.args = args - self.code_id = code_id - self.conf = conf - self.entry = entry - self.environment_id = environment_id - self.environment_variables = environment_variables - self.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - self.queue_settings = queue_settings - self.resources = resources - - -class SparkJobEntry(msrest.serialization.Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SparkJobPythonEntry, SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - } - - _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SparkJobEntry, self).__init__(**kwargs) - self.spark_job_entry_type = None # type: Optional[str] - - -class SparkJobPythonEntry(SparkJobEntry): - """SparkJobPythonEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar file: Required. [Required] Relative python file path for job entry point. - :vartype file: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__( - self, - *, - file: str, - **kwargs - ): - """ - :keyword file: Required. [Required] Relative python file path for job entry point. - :paramtype file: str - """ - super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = file - - -class SparkJobScalaEntry(SparkJobEntry): - """SparkJobScalaEntry. - - All required parameters must be populated in order to send to Azure. - - :ivar spark_job_entry_type: Required. [Required] Type of the job's entry point.Constant filled - by server. Possible values include: "SparkJobPythonEntry", "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.mgmt.machinelearningservices.models.SparkJobEntryType - :ivar class_name: Required. [Required] Scala class name used as entry point. - :vartype class_name: str - """ - - _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, - } - - def __init__( - self, - *, - class_name: str, - **kwargs - ): - """ - :keyword class_name: Required. [Required] Scala class name used as entry point. - :paramtype class_name: str - """ - super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = class_name - - -class SparkResourceConfiguration(msrest.serialization.Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = "3.1", - **kwargs - ): - """ - :keyword instance_type: Optional type of VM used as supported by the compute target. - :paramtype instance_type: str - :keyword runtime_version: Version of spark runtime used for the job. - :paramtype runtime_version: str - """ - super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = instance_type - self.runtime_version = runtime_version - - -class SpeechEndpointDeploymentResourceProperties(EndpointDeploymentResourceProperties, CognitiveServiceEndpointDeploymentResourceProperties): - """SpeechEndpointDeploymentResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar model: Required. Model used for the endpoint deployment. - :vartype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Possible values include: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar type: Required. Kind of the deployment.Constant filled by server. - :vartype type: str - """ - - _validation = { - 'model': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'model': {'key': 'model', 'type': 'EndpointDeploymentModel'}, - 'rai_policy_name': {'key': 'raiPolicyName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'CognitiveServicesSku'}, - 'version_upgrade_option': {'key': 'versionUpgradeOption', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - model: "EndpointDeploymentModel", - rai_policy_name: Optional[str] = None, - sku: Optional["CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "DeploymentModelVersionUpgradeOption"]] = None, - failure_reason: Optional[str] = None, - **kwargs - ): - """ - :keyword model: Required. Model used for the endpoint deployment. - :paramtype model: ~azure.mgmt.machinelearningservices.models.EndpointDeploymentModel - :keyword rai_policy_name: The name of RAI policy. - :paramtype rai_policy_name: str - :keyword sku: - :paramtype sku: ~azure.mgmt.machinelearningservices.models.CognitiveServicesSku - :keyword version_upgrade_option: Deployment model version upgrade option. Possible values - include: "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", "NoAutoUpgrade". - :paramtype version_upgrade_option: str or - ~azure.mgmt.machinelearningservices.models.DeploymentModelVersionUpgradeOption - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - """ - super(SpeechEndpointDeploymentResourceProperties, self).__init__(failure_reason=failure_reason, model=model, rai_policy_name=rai_policy_name, sku=sku, version_upgrade_option=version_upgrade_option, **kwargs) - self.model = model - self.rai_policy_name = rai_policy_name - self.sku = sku - self.version_upgrade_option = version_upgrade_option - self.type = 'Azure.Speech' # type: str - self.failure_reason = failure_reason - self.provisioning_state = None - - -class SpeechEndpointResourceProperties(EndpointResourceProperties): - """SpeechEndpointResourceProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Required. Type of the endpoint.Constant filled by server. Possible values - include: "Azure.OpenAI", "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", - "managedOnlineEndpoint", "serverlessEndpoint". - :vartype endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Possible values include: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", "Disabled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'associated_resource_id': {'key': 'associatedResourceId', 'type': 'str'}, - 'deployments': {'key': 'deployments', 'type': '[EndpointDeploymentResourcePropertiesBasicResource]'}, - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'should_create_ai_services_endpoint': {'key': 'shouldCreateAiServicesEndpoint', 'type': 'bool'}, - } - - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[List["EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - **kwargs - ): - """ - :keyword associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :paramtype associated_resource_id: str - :keyword deployments: Deployments info. - :paramtype deployments: - list[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :keyword endpoint_uri: Uri of the endpoint. - :paramtype endpoint_uri: str - :keyword failure_reason: The failure reason if the creation failed. - :paramtype failure_reason: str - :keyword location: Location of the endpoint. - Since input dto and when parse endpoint resource share the same contract - this Location field is just for parse the endpoint resource info - we won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :paramtype location: str - :keyword name: Name of the endpoint. - :paramtype name: str - :keyword should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :paramtype should_create_ai_services_endpoint: bool - """ - super(SpeechEndpointResourceProperties, self).__init__(associated_resource_id=associated_resource_id, deployments=deployments, endpoint_uri=endpoint_uri, failure_reason=failure_reason, location=location, name=name, should_create_ai_services_endpoint=should_create_ai_services_endpoint, **kwargs) - self.endpoint_type = 'Azure.Speech' # type: str - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "SslConfigStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = status - self.cert = cert - self.key = key - self.cname = cname - self.leaf_domain_label = leaf_domain_label - self.overwrite_existing_domain = overwrite_existing_domain - - -class StackEnsembleSettings(msrest.serialization.Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - - _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, - } - - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, - **kwargs - ): - """ - :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :paramtype stack_meta_learner_k_wargs: any - :keyword stack_meta_learner_train_percentage: Specifies the proportion of the training set - (when choosing train and validation type of training) to be reserved for training the - meta-learner. Default value is 0.2. - :paramtype stack_meta_learner_train_percentage: float - :keyword stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models. Possible values include: "None", "LogisticRegression", - "LogisticRegressionCV", "LightGBMClassifier", "ElasticNet", "ElasticNetCV", - "LightGBMRegressor", "LinearRegression". - :paramtype stack_meta_learner_type: str or - ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType - """ - super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage - self.stack_meta_learner_type = stack_meta_learner_type - - -class StaticInputData(MonitoringInputDataBase): - """Static input data definition. - - All required parameters must be populated in order to send to Azure. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: Required. [Required] Specifies the type of signal to monitor.Constant - filled by server. Possible values include: "Static", "Rolling", "Fixed". - :vartype input_data_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringInputDataType - :ivar job_input_type: Required. [Required] Specifies the type of job. Possible values include: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: Required. [Required] The end date of the data window. - :vartype window_end: ~datetime.datetime - :ivar window_start: Required. [Required] The start date of the data window. - :vartype window_start: ~datetime.datetime - """ - - _validation = { - 'input_data_type': {'required': True}, - 'job_input_type': {'required': True}, - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'window_end': {'required': True}, - 'window_start': {'required': True}, - } - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '{str}'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'input_data_type': {'key': 'inputDataType', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'window_end': {'key': 'windowEnd', 'type': 'iso-8601'}, - 'window_start': {'key': 'windowStart', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - job_input_type: Union[str, "JobInputType"], - uri: str, - window_end: datetime.datetime, - window_start: datetime.datetime, - columns: Optional[Dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - **kwargs - ): - """ - :keyword columns: Mapping of column names to special uses. - :paramtype columns: dict[str, str] - :keyword data_context: The context metadata of the data source. - :paramtype data_context: str - :keyword job_input_type: Required. [Required] Specifies the type of job. Possible values - include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", - "triton_model". - :paramtype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword preprocessing_component_id: Reference to the component asset used to preprocess the - data. - :paramtype preprocessing_component_id: str - :keyword window_end: Required. [Required] The end date of the data window. - :paramtype window_end: ~datetime.datetime - :keyword window_start: Required. [Required] The start date of the data window. - :paramtype window_start: ~datetime.datetime - """ - super(StaticInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Static' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_end = window_end - self.window_start = window_start - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: Details of user created storage account to be used for the - registry. - :vartype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - - _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, - } - - def __init__( - self, - *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, - **kwargs - ): - """ - :keyword system_created_storage_account: Details of system created storage account to be used - for the registry. - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: Details of user created storage account to be used for - the registry. - :paramtype user_created_storage_account: - ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount - """ - super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = system_created_storage_account - self.user_created_storage_account = user_created_storage_account - - -class StringArmPaginatedResult(msrest.serialization.Model): - """A paginated list of String entities. - - :ivar next_link: The link to the next page of String objects. If null, there are no additional - pages. - :vartype next_link: str - :ivar value: An array of objects of type String. - :vartype value: list[str] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[str]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of String objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type String. - :paramtype value: list[str] - """ - super(StringArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class StringKeyValuePair(msrest.serialization.Model): - """StringKeyValuePair. - - :ivar key: - :vartype key: str - :ivar value: - :vartype value: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - :keyword value: - :paramtype value: str - """ - super(StringKeyValuePair, self).__init__(**kwargs) - self.key = key - self.value = value - - -class SweepJob(JobBaseProperties): - """Sweep job definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline", "Spark", "FineTuning", - "Distillation". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :ivar objective: Required. [Required] Optimization objective. - :vartype objective: ~azure.mgmt.machinelearningservices.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :vartype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :ivar search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :vartype search_space: any - :ivar trial: Required. [Required] Trial component definition. - :vartype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'parent_job_name': {'key': 'parentJobName', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - *, - objective: "Objective", - sampling_algorithm: "SamplingAlgorithm", - search_space: Any, - trial: "TrialComponent", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = "Default", - identity: Optional["IdentityConfiguration"] = None, - is_archived: Optional[bool] = False, - notification_setting: Optional["NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[Dict[str, "JobService"]] = None, - early_termination: Optional["EarlyTerminationPolicy"] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - limits: Optional["SweepJobLimits"] = None, - outputs: Optional[Dict[str, "JobOutput"]] = None, - queue_settings: Optional["QueueSettings"] = None, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword component_id: ARM resource ID of the component resource. - :paramtype component_id: str - :keyword compute_id: ARM resource ID of the compute resource. - :paramtype compute_id: str - :keyword display_name: Display name of job. - :paramtype display_name: str - :keyword experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :paramtype experiment_name: str - :keyword identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword notification_setting: Notification setting for the job. - :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :keyword parent_job_name: Parent job name. - :paramtype parent_job_name: str - :keyword services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :keyword early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword inputs: Mapping of input data bindings used in the job. - :paramtype inputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobInput] - :keyword limits: Sweep Job limit. - :paramtype limits: ~azure.mgmt.machinelearningservices.models.SweepJobLimits - :keyword objective: Required. [Required] Optimization objective. - :paramtype objective: ~azure.mgmt.machinelearningservices.models.Objective - :keyword outputs: Mapping of output data bindings used in the job. - :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :keyword queue_settings: Queue settings for the job. - :paramtype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :keyword sampling_algorithm: Required. [Required] The hyperparameter sampling algorithm. - :paramtype sampling_algorithm: ~azure.mgmt.machinelearningservices.models.SamplingAlgorithm - :keyword search_space: Required. [Required] A dictionary containing each parameter and its - distribution. The dictionary key is the name of the parameter. - :paramtype search_space: any - :keyword trial: Required. [Required] Trial component definition. - :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent - """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, parent_job_name=parent_job_name, services=services, **kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = early_termination - self.inputs = inputs - self.limits = limits - self.objective = objective - self.outputs = outputs - self.queue_settings = queue_settings - self.sampling_algorithm = sampling_algorithm - self.search_space = search_space - self.trial = trial - - -class SweepJobLimits(JobLimits): - """Sweep Job limit class. - - All required parameters must be populated in order to send to Azure. - - :ivar job_limits_type: Required. [Required] JobLimit type.Constant filled by server. Possible - values include: "Command", "Sweep". - :vartype job_limits_type: str or ~azure.mgmt.machinelearningservices.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - """ - - _validation = { - 'job_limits_type': {'required': True}, - } - - _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword timeout: The max run duration in ISO 8601 format, after which the job will be - cancelled. Only supports duration with precision as low as Seconds. - :paramtype timeout: ~datetime.timedelta - :keyword max_concurrent_trials: Sweep Job max concurrent trials. - :paramtype max_concurrent_trials: int - :keyword max_total_trials: Sweep Job max total trials. - :paramtype max_total_trials: int - :keyword trial_timeout: Sweep Job Trial timeout value. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = max_concurrent_trials - self.max_total_trials = max_total_trials - self.trial_timeout = trial_timeout - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = properties - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - *, - auto_scale_properties: Optional["AutoScaleProperties"] = None, - auto_pause_properties: Optional["AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = auto_scale_properties - self.auto_pause_properties = auto_pause_properties - self.spark_version = spark_version - self.node_count = node_count - self.node_size = node_size - self.node_size_family = node_size_family - self.subscription_id = subscription_id - self.resource_group = resource_group - self.workspace_name = workspace_name - self.pool_name = pool_name - - -class SystemCreatedAcrAccount(msrest.serialization.Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_name: Optional[str] = None, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_name: Name of the ACR account. - :paramtype acr_account_name: str - :keyword acr_account_sku: SKU of the ACR account. - :paramtype acr_account_sku: str - :keyword arm_resource_id: This is populated once the ACR account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = acr_account_name - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :vartype storage_account_type: str - """ - - _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - allow_blob_public_access: Optional[bool] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_name: Optional[str] = None, - storage_account_type: Optional[str] = None, - **kwargs - ): - """ - :keyword allow_blob_public_access: Public blob access allowed. - :paramtype allow_blob_public_access: bool - :keyword arm_resource_id: This is populated once the storage account is created. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: HNS enabled for storage account. - :paramtype storage_account_hns_enabled: bool - :keyword storage_account_name: Name of the storage account. - :paramtype storage_account_name: str - :keyword storage_account_type: Allowed values: - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Standard_GZRS", - "Standard_RAGZRS", - "Premium_LRS", - "Premium_ZRS". - :paramtype storage_account_type: str - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = allow_blob_public_access - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_name = storage_account_name - self.storage_account_type = storage_account_type - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - - _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, - } - - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, - column_name_and_types: Optional[Dict[str, str]] = None, - enable_dnn_featurization: Optional[bool] = False, - mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, - **kwargs - ): - """ - :keyword dataset_language: Dataset language, useful for the text data. - :paramtype dataset_language: str - :keyword blocked_transformers: These transformers shall not be used in featurization. - :paramtype blocked_transformers: list[str or - ~azure.mgmt.machinelearningservices.models.BlockedTransformers] - :keyword column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :paramtype column_name_and_types: dict[str, str] - :keyword enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :paramtype enable_dnn_featurization: bool - :keyword mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. - If 'Off' is selected then no featurization is done. - If 'Custom' is selected then user can specify additional inputs to customize how featurization - is done. Possible values include: "Auto", "Custom", "Off". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.FeaturizationMode - :keyword transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :paramtype transformer_params: dict[str, - list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] - """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) - self.blocked_transformers = blocked_transformers - self.column_name_and_types = column_name_and_types - self.enable_dnn_featurization = enable_dnn_featurization - self.mode = mode - self.transformer_params = transformer_params - - -class TableVerticalLimitSettings(msrest.serialization.Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - enable_early_termination: Optional[bool] = True, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = 1, - max_cores_per_trial: Optional[int] = -1, - max_trials: Optional[int] = 1000, - timeout: Optional[datetime.timedelta] = "PT6H", - trial_timeout: Optional[datetime.timedelta] = "PT30M", - **kwargs - ): - """ - :keyword enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :paramtype enable_early_termination: bool - :keyword exit_score: Exit score for the AutoML job. - :paramtype exit_score: float - :keyword max_concurrent_trials: Maximum Concurrent iterations. - :paramtype max_concurrent_trials: int - :keyword max_cores_per_trial: Max cores per iteration. - :paramtype max_cores_per_trial: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Iteration timeout. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = enable_early_termination - self.exit_score = exit_score - self.max_concurrent_trials = max_concurrent_trials - self.max_cores_per_trial = max_cores_per_trial - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_timeout - - -class TargetUtilizationScaleSettings(OnlineScaleSettings): - """TargetUtilizationScaleSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar scale_type: Required. [Required] Type of deployment scaling algorithm.Constant filled by - server. Possible values include: "Default", "TargetUtilization". - :vartype scale_type: str or ~azure.mgmt.machinelearningservices.models.ScaleType - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - """ - - _validation = { - 'scale_type': {'required': True}, - } - - _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - max_instances: Optional[int] = 1, - min_instances: Optional[int] = 1, - polling_interval: Optional[datetime.timedelta] = "PT1S", - target_utilization_percentage: Optional[int] = 70, - **kwargs - ): - """ - :keyword max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :paramtype max_instances: int - :keyword min_instances: The minimum number of instances to always be present. - :paramtype min_instances: int - :keyword polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :paramtype polling_interval: ~datetime.timedelta - :keyword target_utilization_percentage: Target CPU usage for the autoscaler. - :paramtype target_utilization_percentage: int - """ - super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = max_instances - self.min_instances = min_instances - self.polling_interval = polling_interval - self.target_utilization_percentage = target_utilization_percentage - - -class TeacherModelEndpoint(msrest.serialization.Model): - """TeacherModelEndpoint. - - :ivar endpoint_name: - :vartype endpoint_name: str - """ - - _attribute_map = { - 'endpoint_name': {'key': 'endpointName', 'type': 'str'}, - } - - def __init__( - self, - *, - endpoint_name: Optional[str] = None, - **kwargs - ): - """ - :keyword endpoint_name: - :paramtype endpoint_name: str - """ - super(TeacherModelEndpoint, self).__init__(**kwargs) - self.endpoint_name = endpoint_name - - -class TeacherModelEndpointRequestSettings(msrest.serialization.Model): - """TeacherModelEndpointRequestSettings. - - :ivar min_endpoint_success_ratio: - :vartype min_endpoint_success_ratio: float - :ivar request_batch_size: - :vartype request_batch_size: int - """ - - _attribute_map = { - 'min_endpoint_success_ratio': {'key': 'minEndpointSuccessRatio', 'type': 'float'}, - 'request_batch_size': {'key': 'requestBatchSize', 'type': 'int'}, - } - - def __init__( - self, - *, - min_endpoint_success_ratio: Optional[float] = None, - request_batch_size: Optional[int] = None, - **kwargs - ): - """ - :keyword min_endpoint_success_ratio: - :paramtype min_endpoint_success_ratio: float - :keyword request_batch_size: - :paramtype request_batch_size: int - """ - super(TeacherModelEndpointRequestSettings, self).__init__(**kwargs) - self.min_endpoint_success_ratio = min_endpoint_success_ratio - self.request_batch_size = request_batch_size - - -class TeacherModelSettings(msrest.serialization.Model): - """TeacherModelSettings. - - :ivar teacher_model_endpoint_request_settings: Teacher Model Request Settings. - :vartype teacher_model_endpoint_request_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpointRequestSettings - :ivar teacher_model_inference_parameters: Teacher Model Inference Settings. - :vartype teacher_model_inference_parameters: dict[str, str] - """ - - _attribute_map = { - 'teacher_model_endpoint_request_settings': {'key': 'teacherModelEndpointRequestSettings', 'type': 'TeacherModelEndpointRequestSettings'}, - 'teacher_model_inference_parameters': {'key': 'teacherModelInferenceParameters', 'type': '{str}'}, - } - - def __init__( - self, - *, - teacher_model_endpoint_request_settings: Optional["TeacherModelEndpointRequestSettings"] = None, - teacher_model_inference_parameters: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword teacher_model_endpoint_request_settings: Teacher Model Request Settings. - :paramtype teacher_model_endpoint_request_settings: - ~azure.mgmt.machinelearningservices.models.TeacherModelEndpointRequestSettings - :keyword teacher_model_inference_parameters: Teacher Model Inference Settings. - :paramtype teacher_model_inference_parameters: dict[str, str] - """ - super(TeacherModelSettings, self).__init__(**kwargs) - self.teacher_model_endpoint_request_settings = teacher_model_endpoint_request_settings - self.teacher_model_inference_parameters = teacher_model_inference_parameters - - -class TensorFlow(DistributionConfiguration): - """TensorFlow distribution configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar distribution_type: Required. [Required] Specifies the type of distribution - framework.Constant filled by server. Possible values include: "PyTorch", "TensorFlow", "Mpi". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, - } - - def __init__( - self, - *, - parameter_server_count: Optional[int] = 0, - worker_count: Optional[int] = None, - **kwargs - ): - """ - :keyword parameter_server_count: Number of parameter server tasks. - :paramtype parameter_server_count: int - :keyword worker_count: Number of workers. If not specified, will default to the instance count. - :paramtype worker_count: int - """ - super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = parameter_server_count - self.worker_count = worker_count - - -class TextClassification(AutoMLVertical, NlpVertical): - """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :paramtype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str - self.primary_metric = primary_metric - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextClassificationMultilabel(AutoMLVertical, NlpVertical): - """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TextNer(AutoMLVertical, NlpVertical): - """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics - """ - - _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, - } - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - *, - training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - validation_data: Optional["MLTableJobInput"] = None, - log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - **kwargs - ): - """ - :keyword featurization_settings: Featurization inputs needed for AutoML job. - :paramtype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword validation_data: Validation data inputs. - :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :keyword target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :paramtype target_column_name: str - :keyword training_data: Required. [Required] Training data input. - :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.limit_settings = limit_settings - self.validation_data = validation_data - self.task_type = 'TextNER' # type: str - self.primary_metric = None - self.log_verbosity = log_verbosity - self.target_column_name = target_column_name - self.training_data = training_data - - -class TmpfsOptions(msrest.serialization.Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, - } - - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): - """ - :keyword size: Mention the Tmpfs size. - :paramtype size: int - """ - super(TmpfsOptions, self).__init__(**kwargs) - self.size = size - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): - """TopNFeaturesByAttribution. - - All required parameters must be populated in order to send to Azure. - - :ivar filter_type: Required. [Required] Specifies the feature filter to leverage when selecting - features to calculate metrics over.Constant filled by server. Possible values include: - "AllFeatures", "TopNByAttribution", "FeatureSubset". - :vartype filter_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringFeatureFilterType - :ivar top: The number of top features to include. - :vartype top: int - """ - - _validation = { - 'filter_type': {'required': True}, - } - - _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - top: Optional[int] = 10, - **kwargs - ): - """ - :keyword top: The number of top features to include. - :paramtype top: int - """ - super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = top - - -class TrialComponent(msrest.serialization.Model): - """Trial component definition. - - All required parameters must be populated in order to send to Azure. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: Required. [Required] The command to execute on startup of the job. eg. "python - train.py". - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :ivar environment_id: Required. [Required] The ARM resource ID of the Environment specification - for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - - _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["DistributionConfiguration"] = None, - environment_variables: Optional[Dict[str, str]] = None, - resources: Optional["JobResourceConfiguration"] = None, - **kwargs - ): - """ - :keyword code_id: ARM resource ID of the code asset. - :paramtype code_id: str - :keyword command: Required. [Required] The command to execute on startup of the job. eg. - "python train.py". - :paramtype command: str - :keyword distribution: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :paramtype distribution: ~azure.mgmt.machinelearningservices.models.DistributionConfiguration - :keyword environment_id: Required. [Required] The ARM resource ID of the Environment - specification for the job. - :paramtype environment_id: str - :keyword environment_variables: Environment variables included in the job. - :paramtype environment_variables: dict[str, str] - :keyword resources: Compute Resource configuration for the job. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - """ - super(TrialComponent, self).__init__(**kwargs) - self.code_id = code_id - self.command = command - self.distribution = distribution - self.environment_id = environment_id - self.environment_variables = environment_variables - self.resources = resources - - -class TritonModelJobInput(JobInput, AssetJobInput): - """TritonModelJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'triton_model' # type: str - self.description = description - - -class TritonModelJobOutput(JobOutput, AssetJobOutput): - """TritonModelJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.mode = mode - self.uri = uri - self.job_output_type = 'triton_model' # type: str - self.description = description - - -class TruncationSelectionPolicy(EarlyTerminationPolicy): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. - - All required parameters must be populated in order to send to Azure. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: Required. [Required] Name of policy configuration.Constant filled by server. - Possible values include: "Bandit", "MedianStopping", "TruncationSelection". - :vartype policy_type: str or - ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicyType - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - """ - - _validation = { - 'policy_type': {'required': True}, - } - - _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, - } - - def __init__( - self, - *, - delay_evaluation: Optional[int] = 0, - evaluation_interval: Optional[int] = 0, - truncation_percentage: Optional[int] = 0, - **kwargs - ): - """ - :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. - :paramtype delay_evaluation: int - :keyword evaluation_interval: Interval (number of runs) between policy evaluations. - :paramtype evaluation_interval: int - :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :paramtype truncation_percentage: int - """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = truncation_percentage - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - limit: Optional[int] = None, - status: Optional[Union[str, "Status"]] = None, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = limit - self.unit = None - self.status = status - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class UriFileDataVersion(DataVersionBaseProperties): - """uri-file data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_file' # type: str - - -class UriFileJobInput(JobInput, AssetJobInput): - """UriFileJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_file' # type: str - self.description = description - - -class UriFileJobOutput(JobOutput, AssetJobOutput): - """UriFileJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_file' # type: str - self.description = description - - -class UriFolderDataVersion(DataVersionBaseProperties): - """uri-folder data version entity. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "uri_file", "uri_folder", "mltable". - :vartype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType - :ivar data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :vartype data_uri: str - """ - - _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - **kwargs - ): - """ - :keyword description: The asset description text. - :paramtype description: str - :keyword properties: The asset property dictionary. - :paramtype properties: dict[str, str] - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword is_anonymous: If the name version are system generated (anonymous registration). - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived?. - :paramtype is_archived: bool - :keyword data_uri: Required. [Required] Uri of the data. Example: - https://go.microsoft.com/fwlink/?linkid=2202330. - :paramtype data_uri: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_folder' # type: str - - -class UriFolderJobInput(JobInput, AssetJobInput): - """UriFolderJobInput. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :ivar uri: Required. [Required] Input Asset URI. - :vartype uri: str - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "literal", "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_input_type: str or ~azure.mgmt.machinelearningservices.models.JobInputType - """ - - _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: str, - mode: Optional[Union[str, "InputDeliveryMode"]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDeliveryMode - :keyword uri: Required. [Required] Input Asset URI. - :paramtype uri: str - :keyword description: Description for the input. - :paramtype description: str - """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) - self.mode = mode - self.uri = uri - self.job_input_type = 'uri_folder' # type: str - self.description = description - - -class UriFolderJobOutput(JobOutput, AssetJobOutput): - """UriFolderJobOutput. - - All required parameters must be populated in order to send to Azure. - - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: Required. [Required] Specifies the type of job.Constant filled by - server. Possible values include: "uri_file", "uri_folder", "mltable", "custom_model", - "mlflow_model", "triton_model". - :vartype job_output_type: str or ~azure.mgmt.machinelearningservices.models.JobOutputType - """ - - _validation = { - 'job_output_type': {'required': True}, - } - - _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", - "Direct". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode - :keyword uri: Output Asset URI. - :paramtype uri: str - :keyword description: Description for the output. - :paramtype description: str - """ - super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.mode = mode - self.uri = uri - self.job_output_type = 'uri_folder' # type: str - self.description = description - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageAndQuotaDetails(msrest.serialization.Model): - """UsageAndQuotaDetails. - - :ivar model_collection: Model collection name. - :vartype model_collection: str - :ivar quota: The total number of quota. - :vartype quota: long - :ivar usage_details: Usage details for each deployment. - :vartype usage_details: list[~azure.mgmt.machinelearningservices.models.PTUDeploymentUsage] - """ - - _attribute_map = { - 'model_collection': {'key': 'modelCollection', 'type': 'str'}, - 'quota': {'key': 'quota', 'type': 'long'}, - 'usage_details': {'key': 'usageDetails', 'type': '[PTUDeploymentUsage]'}, - } - - def __init__( - self, - *, - model_collection: Optional[str] = None, - quota: Optional[int] = None, - usage_details: Optional[List["PTUDeploymentUsage"]] = None, - **kwargs - ): - """ - :keyword model_collection: Model collection name. - :paramtype model_collection: str - :keyword quota: The total number of quota. - :paramtype quota: long - :keyword usage_details: Usage details for each deployment. - :paramtype usage_details: list[~azure.mgmt.machinelearningservices.models.PTUDeploymentUsage] - """ - super(UsageAndQuotaDetails, self).__init__(**kwargs) - self.model_collection = model_collection - self.quota = quota - self.usage_details = usage_details - - -class UsageAndQuotaDetailsArmPaginatedResult(msrest.serialization.Model): - """A paginated list of UsageAndQuotaDetails entities. - - :ivar next_link: The link to the next page of UsageAndQuotaDetails objects. If null, there are - no additional pages. - :vartype next_link: str - :ivar value: An array of objects of type UsageAndQuotaDetails. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UsageAndQuotaDetails] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[UsageAndQuotaDetails]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["UsageAndQuotaDetails"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of UsageAndQuotaDetails objects. If null, there - are no additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type UsageAndQuotaDetails. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.UsageAndQuotaDetails] - """ - super(UsageAndQuotaDetailsArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = admin_user_name - self.admin_user_ssh_public_key = admin_user_ssh_public_key - self.admin_user_password = admin_user_password - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserCreatedAcrAccount(msrest.serialization.Model): - """UserCreatedAcrAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserCreatedStorageAccount(msrest.serialization.Model): - """UserCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - - -class UserIdentity(IdentityConfiguration): - """User identity configuration. - - All required parameters must be populated in order to send to Azure. - - :ivar identity_type: Required. [Required] Specifies the type of identity framework.Constant - filled by server. Possible values include: "Managed", "AMLToken", "UserIdentity". - :vartype identity_type: str or - ~azure.mgmt.machinelearningservices.models.IdentityConfigurationType - """ - - _validation = { - 'identity_type': {'required': True}, - } - - _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "AccountKey", "ServicePrincipal", "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Possible values include: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", "ServicesAndApps". - :vartype group: str or ~azure.mgmt.machinelearningservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :ivar pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - 'created_by_workspace_arm_id': {'readonly': True}, - 'group': {'readonly': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'created_by_workspace_arm_id': {'key': 'createdByWorkspaceArmId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'group': {'key': 'group', 'type': 'str'}, - 'is_shared_to_all': {'key': 'isSharedToAll', 'type': 'bool'}, - 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'pe_requirement': {'key': 'peRequirement', 'type': 'str'}, - 'pe_status': {'key': 'peStatus', 'type': 'str'}, - 'shared_user_list': {'key': 'sharedUserList', 'type': '[str]'}, - 'target': {'key': 'target', 'type': 'str'}, - 'use_workspace_managed_identity': {'key': 'useWorkspaceManagedIdentity', 'type': 'bool'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[Dict[str, str]] = None, - pe_requirement: Optional[Union[str, "ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "ManagedPEStatus"]] = None, - shared_user_list: Optional[List[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureOneLake", "CosmosDb", - "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", "AzureDatabricksDeltaLake", - "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", "AmazonRdsForSqlServer", - "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", "Hbase", "Hive", "Impala", - "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", "Oracle", "Phoenix", - "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", "Spark", "SqlServer", - "Sybase", "Teradata", "Vertica", "Pinecone", "Cassandra", "Couchbase", "MongoDbV2", - "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", - "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", "GenericRest", "AmazonMws", - "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", - "Magento", "Marketo", "Office365", "Eloqua", "Responsys", "OracleServiceCloud", "PayPal", - "QuickBooks", "Salesforce", "SalesforceServiceCloud", "SalesforceMarketingCloud", - "SapCloudForCustomer", "SapEcc", "ServiceNow", "SharePointOnlineList", "Shopify", "Square", - "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword error: - :paramtype error: str - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword is_shared_to_all: - :paramtype is_shared_to_all: bool - :keyword metadata: Store user metadata for this connection. - :paramtype metadata: dict[str, str] - :keyword pe_requirement: Possible values include: "Required", "NotRequired", "NotApplicable". - :paramtype pe_requirement: str or - ~azure.mgmt.machinelearningservices.models.ManagedPERequirement - :keyword pe_status: Possible values include: "Inactive", "Active", "NotApplicable". - :paramtype pe_status: str or ~azure.mgmt.machinelearningservices.models.ManagedPEStatus - :keyword shared_user_list: - :paramtype shared_user_list: list[str] - :keyword target: - :paramtype target: str - :keyword use_workspace_managed_identity: - :paramtype use_workspace_managed_identity: bool - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, error=error, expiry_time=expiry_time, is_shared_to_all=is_shared_to_all, metadata=metadata, pe_requirement=pe_requirement, pe_status=pe_status, shared_user_list=shared_user_list, target=target, use_workspace_managed_identity=use_workspace_managed_identity, **kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = credentials - - -class VirtualMachineSchema(msrest.serialization.Model): - """VirtualMachineSchema. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - """ - super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = properties - - -class VirtualMachine(Compute, VirtualMachineSchema): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["VirtualMachineSchemaProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = id - - -class VirtualMachineSchemaProperties(msrest.serialization.Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - notebook_server_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword notebook_server_port: Notebook server port open for ssh connections. - :paramtype notebook_server_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = virtual_machine_size - self.ssh_port = ssh_port - self.notebook_server_port = notebook_server_port - self.address = address - self.administrator_account = administrator_account - self.is_notebook_instance_compute = is_notebook_instance_compute - - -class VirtualMachineSecretsSchema(msrest.serialization.Model): - """VirtualMachineSecretsSchema. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = administrator_account - - -class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) - self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - estimated_vm_prices: Optional["EstimatedVMPrices"] = None, - supported_compute_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = estimated_vm_prices - self.supported_compute_types = supported_compute_types - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = value - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = username - self.password = password - self.public_key_data = public_key_data - self.private_key_data = private_key_data - - -class VolumeDefinition(msrest.serialization.Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "VolumeDefinitionType"]] = "bind", - read_only: Optional[bool] = None, - source: Optional[str] = None, - target: Optional[str] = None, - consistency: Optional[str] = None, - bind: Optional["BindOptions"] = None, - volume: Optional["VolumeOptions"] = None, - tmpfs: Optional["TmpfsOptions"] = None, - **kwargs - ): - """ - :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible - values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.VolumeDefinitionType - :keyword read_only: Indicate whether to mount volume as readOnly. Default value for this is - false. - :paramtype read_only: bool - :keyword source: Source of the mount. For bind mounts this is the host path. - :paramtype source: str - :keyword target: Target of the mount. For bind mounts this is the path in the container. - :paramtype target: str - :keyword consistency: Consistency of the volume. - :paramtype consistency: str - :keyword bind: Bind Options of the mount. - :paramtype bind: ~azure.mgmt.machinelearningservices.models.BindOptions - :keyword volume: Volume Options of the mount. - :paramtype volume: ~azure.mgmt.machinelearningservices.models.VolumeOptions - :keyword tmpfs: tmpfs option of the mount. - :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions - """ - super(VolumeDefinition, self).__init__(**kwargs) - self.type = type - self.read_only = read_only - self.source = source - self.target = target - self.consistency = consistency - self.bind = bind - self.volume = volume - self.tmpfs = tmpfs - - -class VolumeOptions(msrest.serialization.Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, - } - - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): - """ - :keyword nocopy: Indicate whether volume is nocopy. - :paramtype nocopy: bool - """ - super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = nocopy - - -class VulnerabilityDetails(msrest.serialization.Model): - """VulnerabilityDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cve: CVE id. - :vartype cve: str - :ivar cve_url: CVE url. - :vartype cve_url: str - :ivar due_date: DueDate for vulnerability. Provider data or PublishDate + 30 days. - :vartype due_date: ~datetime.datetime - :ivar id: Vulnerability ID. - :vartype id: str - :ivar package_details: Dependency details. - :vartype package_details: list[~azure.mgmt.machinelearningservices.models.PackageDetails] - :ivar patchable: Indicates if there is a known patch for vulnerability. - :vartype patchable: bool - :ivar provider_id: Vulnerability ID from provider. - :vartype provider_id: str - :ivar publish_date: Vulnerability publish date. - :vartype publish_date: ~datetime.datetime - :ivar risk: Vulnerability Risk value. Possible values include: "UNKNOWN", "CRITICAL", "HIGH", - "MEDIUM", "LOW". - :vartype risk: str or ~azure.mgmt.machinelearningservices.models.VulnerabilityRisk - :ivar solution: Vulnerability description. - :vartype solution: str - :ivar title: Vulnerability name. - :vartype title: str - :ivar vendor_id: Vendor vulnerability ID (USN, GH Advisory, etc). - :vartype vendor_id: str - :ivar vendor_url: Vendor vulnerability url. - :vartype vendor_url: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'cve': {'key': 'cve', 'type': 'str'}, - 'cve_url': {'key': 'cveUrl', 'type': 'str'}, - 'due_date': {'key': 'dueDate', 'type': 'iso-8601'}, - 'id': {'key': 'id', 'type': 'str'}, - 'package_details': {'key': 'packageDetails', 'type': '[PackageDetails]'}, - 'patchable': {'key': 'patchable', 'type': 'bool'}, - 'provider_id': {'key': 'providerId', 'type': 'str'}, - 'publish_date': {'key': 'publishDate', 'type': 'iso-8601'}, - 'risk': {'key': 'risk', 'type': 'str'}, - 'solution': {'key': 'solution', 'type': 'str'}, - 'title': {'key': 'title', 'type': 'str'}, - 'vendor_id': {'key': 'vendorId', 'type': 'str'}, - 'vendor_url': {'key': 'vendorUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - cve: Optional[str] = None, - cve_url: Optional[str] = None, - due_date: Optional[datetime.datetime] = None, - package_details: Optional[List["PackageDetails"]] = None, - patchable: Optional[bool] = None, - provider_id: Optional[str] = None, - publish_date: Optional[datetime.datetime] = None, - risk: Optional[Union[str, "VulnerabilityRisk"]] = None, - solution: Optional[str] = None, - title: Optional[str] = None, - vendor_id: Optional[str] = None, - vendor_url: Optional[str] = None, - **kwargs - ): - """ - :keyword cve: CVE id. - :paramtype cve: str - :keyword cve_url: CVE url. - :paramtype cve_url: str - :keyword due_date: DueDate for vulnerability. Provider data or PublishDate + 30 days. - :paramtype due_date: ~datetime.datetime - :keyword package_details: Dependency details. - :paramtype package_details: list[~azure.mgmt.machinelearningservices.models.PackageDetails] - :keyword patchable: Indicates if there is a known patch for vulnerability. - :paramtype patchable: bool - :keyword provider_id: Vulnerability ID from provider. - :paramtype provider_id: str - :keyword publish_date: Vulnerability publish date. - :paramtype publish_date: ~datetime.datetime - :keyword risk: Vulnerability Risk value. Possible values include: "UNKNOWN", "CRITICAL", - "HIGH", "MEDIUM", "LOW". - :paramtype risk: str or ~azure.mgmt.machinelearningservices.models.VulnerabilityRisk - :keyword solution: Vulnerability description. - :paramtype solution: str - :keyword title: Vulnerability name. - :paramtype title: str - :keyword vendor_id: Vendor vulnerability ID (USN, GH Advisory, etc). - :paramtype vendor_id: str - :keyword vendor_url: Vendor vulnerability url. - :paramtype vendor_url: str - """ - super(VulnerabilityDetails, self).__init__(**kwargs) - self.cve = cve - self.cve_url = cve_url - self.due_date = due_date - self.id = None - self.package_details = package_details - self.patchable = patchable - self.provider_id = provider_id - self.publish_date = publish_date - self.risk = risk - self.solution = solution - self.title = title - self.vendor_id = vendor_id - self.vendor_url = vendor_url - - -class VulnerabilityFindings(msrest.serialization.Model): - """VulnerabilityFindings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar asset_id: AssetId (Image digest). - :vartype asset_id: str - :ivar critical_findings_count: Number of critical findings. - :vartype critical_findings_count: int - :ivar data: List of vulnerability findings. - :vartype data: list[~azure.mgmt.machinelearningservices.models.VulnerabilityDetails] - :ivar generated_time: Time the report was generated. - :vartype generated_time: ~datetime.datetime - :ivar high_findings_count: Number of high findings. - :vartype high_findings_count: int - :ivar last_scan_date: Scan result date. - :vartype last_scan_date: ~datetime.datetime - :ivar scanner: Vulnerability scanner name. - :vartype scanner: str - :ivar source: Data source (internal). - :vartype source: str - :ivar total_findings_count: Total findings count. - :vartype total_findings_count: int - """ - - _validation = { - 'critical_findings_count': {'readonly': True}, - 'high_findings_count': {'readonly': True}, - 'total_findings_count': {'readonly': True}, - } - - _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'critical_findings_count': {'key': 'criticalFindingsCount', 'type': 'int'}, - 'data': {'key': 'data', 'type': '[VulnerabilityDetails]'}, - 'generated_time': {'key': 'generatedTime', 'type': 'iso-8601'}, - 'high_findings_count': {'key': 'highFindingsCount', 'type': 'int'}, - 'last_scan_date': {'key': 'lastScanDate', 'type': 'iso-8601'}, - 'scanner': {'key': 'scanner', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'total_findings_count': {'key': 'totalFindingsCount', 'type': 'int'}, - } - - def __init__( - self, - *, - asset_id: Optional[str] = None, - data: Optional[List["VulnerabilityDetails"]] = None, - generated_time: Optional[datetime.datetime] = None, - last_scan_date: Optional[datetime.datetime] = None, - scanner: Optional[str] = None, - source: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_id: AssetId (Image digest). - :paramtype asset_id: str - :keyword data: List of vulnerability findings. - :paramtype data: list[~azure.mgmt.machinelearningservices.models.VulnerabilityDetails] - :keyword generated_time: Time the report was generated. - :paramtype generated_time: ~datetime.datetime - :keyword last_scan_date: Scan result date. - :paramtype last_scan_date: ~datetime.datetime - :keyword scanner: Vulnerability scanner name. - :paramtype scanner: str - :keyword source: Data source (internal). - :paramtype source: str - """ - super(VulnerabilityFindings, self).__init__(**kwargs) - self.asset_id = asset_id - self.critical_findings_count = None - self.data = data - self.generated_time = generated_time - self.high_findings_count = None - self.last_scan_date = last_scan_date - self.scanner = scanner - self.source = source - self.total_findings_count = None - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. Dictionary of :code:``. - :vartype tags: dict[str, str] - :ivar agents_endpoint_uri: The URI of agents endpoint associated with this workspace. - :vartype agents_endpoint_uri: str - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment for - the workspace MSI on resource group level. - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_service_side_cmk_encryption: - :vartype enable_service_side_cmk_encryption: bool - :ivar enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :vartype enable_simplified_cmk: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar network_acls: A set of rules governing the network accessibility of the workspace. - :vartype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provision_network_now: Set to trigger the provisioning of the managed VNet with the - default Options when creating a Workspace with the managed VNet enabled, or else it does - nothing. - :vartype provision_network_now: bool - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :vartype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'agents_endpoint_uri': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'workspace_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'agents_endpoint_uri': {'key': 'properties.agentsEndpointUri', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_service_side_cmk_encryption': {'key': 'properties.enableServiceSideCMKEncryption', 'type': 'bool'}, - 'enable_simplified_cmk': {'key': 'properties.enableSimplifiedCmk', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'network_acls': {'key': 'properties.networkAcls', 'type': 'NetworkAcls'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'provision_network_now': {'key': 'properties.provisionNetworkNow', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'workspace_hub_config': {'key': 'properties.workspaceHubConfig', 'type': 'WorkspaceHubConfig'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - allow_public_access_when_behind_vnet: Optional[bool] = None, - allow_role_assignment_on_rg: Optional[bool] = None, - application_insights: Optional[str] = None, - associated_workspaces: Optional[List[str]] = None, - container_registries: Optional[List[str]] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - discovery_url: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_service_side_cmk_encryption: Optional[bool] = None, - enable_simplified_cmk: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionProperty"] = None, - existing_workspaces: Optional[List[str]] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - hbi_workspace: Optional[bool] = None, - hub_resource_id: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - key_vault: Optional[str] = None, - key_vaults: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - network_acls: Optional["NetworkAcls"] = None, - primary_user_assigned_identity: Optional[str] = None, - provision_network_now: Optional[bool] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - soft_delete_retention_in_days: Optional[int] = None, - storage_account: Optional[str] = None, - storage_accounts: Optional[List[str]] = None, - system_datastores_auth_mode: Optional[Union[str, "SystemDatastoresAuthMode"]] = None, - v1_legacy_mode: Optional[bool] = None, - workspace_hub_config: Optional["WorkspaceHubConfig"] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword kind: - :paramtype kind: str - :keyword location: - :paramtype location: str - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. Dictionary of :code:``. - :paramtype tags: dict[str, str] - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment - for the workspace MSI on resource group level. - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword associated_workspaces: - :paramtype associated_workspaces: list[str] - :keyword container_registries: - :paramtype container_registries: list[str] - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_service_side_cmk_encryption: - :paramtype enable_service_side_cmk_encryption: bool - :keyword enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :paramtype enable_simplified_cmk: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword existing_workspaces: - :paramtype existing_workspaces: list[str] - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword hub_resource_id: - :paramtype hub_resource_id: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword key_vaults: - :paramtype key_vaults: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword network_acls: A set of rules governing the network accessibility of the workspace. - :paramtype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword provision_network_now: Set to trigger the provisioning of the managed VNet with the - default Options when creating a Workspace with the managed VNet enabled, or else it does - nothing. - :paramtype provision_network_now: bool - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword storage_accounts: - :paramtype storage_accounts: list[str] - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :paramtype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - :keyword workspace_hub_config: WorkspaceHub's configuration object. - :paramtype workspace_hub_config: ~azure.mgmt.machinelearningservices.models.WorkspaceHubConfig - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.kind = kind - self.location = location - self.sku = sku - self.tags = tags - self.agents_endpoint_uri = None - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet - self.allow_role_assignment_on_rg = allow_role_assignment_on_rg - self.application_insights = application_insights - self.associated_workspaces = associated_workspaces - self.container_registries = container_registries - self.container_registry = container_registry - self.description = description - self.discovery_url = discovery_url - self.enable_data_isolation = enable_data_isolation - self.enable_service_side_cmk_encryption = enable_service_side_cmk_encryption - self.enable_simplified_cmk = enable_simplified_cmk - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.existing_workspaces = existing_workspaces - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.hbi_workspace = hbi_workspace - self.hub_resource_id = hub_resource_id - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.key_vault = key_vault - self.key_vaults = key_vaults - self.managed_network = managed_network - self.ml_flow_tracking_uri = None - self.network_acls = network_acls - self.notebook_info = None - self.primary_user_assigned_identity = primary_user_assigned_identity - self.private_endpoint_connections = None - self.private_link_count = None - self.provision_network_now = provision_network_now - self.provisioning_state = None - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.service_provisioned_resource_group = None - self.shared_private_link_resources = shared_private_link_resources - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.storage_account = storage_account - self.storage_accounts = storage_accounts - self.storage_hns_enabled = None - self.system_datastores_auth_mode = system_datastores_auth_mode - self.tenant_id = None - self.v1_legacy_mode = v1_legacy_mode - self.workspace_hub_config = workspace_hub_config - self.workspace_id = None - - -class WorkspaceConnectionAccessKey(msrest.serialization.Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, - } - - def __init__( - self, - *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, - **kwargs - ): - """ - :keyword access_key_id: - :paramtype access_key_id: str - :keyword secret_access_key: - :paramtype secret_access_key: str - """ - super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = access_key_id - self.secret_access_key = secret_access_key - - -class WorkspaceConnectionAccountKey(msrest.serialization.Model): - """Account key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionAccountKey, self).__init__(**kwargs) - self.key = key - - -class WorkspaceConnectionApiKey(msrest.serialization.Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword key: - :paramtype key: str - """ - super(WorkspaceConnectionApiKey, self).__init__(**kwargs) - self.key = key - - -class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword resource_id: - :paramtype resource_id: str - """ - super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.client_id = client_id - self.resource_id = resource_id - - -class WorkspaceConnectionOAuth2(msrest.serialization.Model): - """ClientId and ClientSecret are required. Other properties are optional -depending on each OAuth2 provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :vartype username: str - """ - - _attribute_map = { - 'auth_url': {'key': 'authUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'developer_token': {'key': 'developerToken', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - auth_url: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - developer_token: Optional[str] = None, - password: Optional[str] = None, - refresh_token: Optional[str] = None, - tenant_id: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword auth_url: Required by Concur connection category. - :paramtype auth_url: str - :keyword client_id: Client id in the format of UUID. - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword developer_token: Required by GoogleAdWords connection category. - :paramtype developer_token: str - :keyword password: - :paramtype password: str - :keyword refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho - where user needs to get RefreshToken offline. - :paramtype refresh_token: str - :keyword tenant_id: Required by QuickBooks and Xero connection categories. - :paramtype tenant_id: str - :keyword username: Concur, ServiceNow auth server AccessToken grant type is 'Password' - which requires UsernamePassword. - :paramtype username: str - """ - super(WorkspaceConnectionOAuth2, self).__init__(**kwargs) - self.auth_url = auth_url - self.client_id = client_id - self.client_secret = client_secret - self.developer_token = developer_token - self.password = password - self.refresh_token = refresh_token - self.tenant_id = tenant_id - self.username = username - - -class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = pat - - -class WorkspaceConnectionPropertiesV2BasicResource(Resource): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - :ivar next_link: - :vartype next_link: str - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, - **kwargs - ): - """ - :keyword next_link: - :paramtype next_link: str - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - self.tenant_id = tenant_id - - -class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = sas - - -class WorkspaceConnectionUpdateParameter(msrest.serialization.Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: Optional["WorkspaceConnectionPropertiesV2"] = None, - **kwargs - ): - """ - :keyword properties: The properties that the machine learning workspace connection will be - updated with. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionUpdateParameter, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'security_token': {'key': 'securityToken', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - security_token: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword security_token: Optional, required by connections like SalesForce for extra security - in addition to UsernamePassword. - :paramtype security_token: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = password - self.security_token = security_token - self.username = username - - -class WorkspaceHubConfig(msrest.serialization.Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - _attribute_map = { - 'additional_workspace_storage_accounts': {'key': 'additionalWorkspaceStorageAccounts', 'type': '[str]'}, - 'default_workspace_resource_group': {'key': 'defaultWorkspaceResourceGroup', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_workspace_storage_accounts: Optional[List[str]] = None, - default_workspace_resource_group: Optional[str] = None, - **kwargs - ): - """ - :keyword additional_workspace_storage_accounts: - :paramtype additional_workspace_storage_accounts: list[str] - :keyword default_workspace_resource_group: - :paramtype default_workspace_resource_group: str - """ - super(WorkspaceHubConfig, self).__init__(**kwargs) - self.additional_workspace_storage_accounts = additional_workspace_storage_accounts - self.default_workspace_resource_group = default_workspace_resource_group - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Workspace]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["Workspace"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class WorkspacePrivateEndpointResource(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkspacePrivateEndpointResource, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar allow_role_assignment_on_rg: - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :ivar network_acls: A set of rules governing the network accessibility of the workspace. - :vartype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :vartype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'allow_role_assignment_on_rg': {'key': 'properties.allowRoleAssignmentOnRG', 'type': 'bool'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'enable_software_bill_of_materials': {'key': 'properties.enableSoftwareBillOfMaterials', 'type': 'bool'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'ip_allowlist': {'key': 'properties.ipAllowlist', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'network_acls': {'key': 'properties.networkAcls', 'type': 'NetworkAcls'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - sku: Optional["Sku"] = None, - tags: Optional[Dict[str, str]] = None, - allow_role_assignment_on_rg: Optional[bool] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[List[str]] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - network_acls: Optional["NetworkAcls"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - soft_delete_retention_in_days: Optional[int] = None, - system_datastores_auth_mode: Optional[Union[str, "SystemDatastoresAuthMode"]] = None, - v1_legacy_mode: Optional[bool] = None, - **kwargs - ): - """ - :keyword identity: Managed service identity (system assigned and/or user assigned identities). - :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity - :keyword sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword allow_role_assignment_on_rg: - :paramtype allow_role_assignment_on_rg: bool - :keyword application_insights: ARM id of the application insights associated with this - workspace. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :paramtype container_registry: str - :keyword description: The description of this workspace. - :paramtype description: str - :keyword enable_data_isolation: - :paramtype enable_data_isolation: bool - :keyword enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :paramtype enable_software_bill_of_materials: bool - :keyword encryption: - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :paramtype ip_allowlist: list[str] - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - :keyword network_acls: A set of rules governing the network accessibility of the workspace. - :paramtype network_acls: ~azure.mgmt.machinelearningservices.models.NetworkAcls - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccessType - :keyword serverless_compute_settings: Settings for serverless compute in a workspace. - :paramtype serverless_compute_settings: - ~azure.mgmt.machinelearningservices.models.ServerlessComputeSettings - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword soft_delete_retention_in_days: Retention time in days after workspace get soft - deleted. - :paramtype soft_delete_retention_in_days: int - :keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Possible values include: "AccessKey", "Identity", "UserDelegationSAS". - :paramtype system_datastores_auth_mode: str or - ~azure.mgmt.machinelearningservices.models.SystemDatastoresAuthMode - :keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided - by the v2 API. - :paramtype v1_legacy_mode: bool - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - self.allow_role_assignment_on_rg = allow_role_assignment_on_rg - self.application_insights = application_insights - self.container_registry = container_registry - self.description = description - self.enable_data_isolation = enable_data_isolation - self.enable_software_bill_of_materials = enable_software_bill_of_materials - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.ip_allowlist = ip_allowlist - self.managed_network = managed_network - self.network_acls = network_acls - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access - self.serverless_compute_settings = serverless_compute_settings - self.service_managed_resources_settings = service_managed_resources_settings - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.system_datastores_auth_mode = system_datastores_auth_mode - self.v1_legacy_mode = v1_legacy_mode diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/__init__.py deleted file mode 100644 index 9f0cf9c2520b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/__init__.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._registries_operations import RegistriesOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._ptu_quota_operations import PTUQuotaOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations -from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations -from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_data_references_operations import RegistryDataReferencesOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations -from ._batch_endpoints_operations import BatchEndpointsOperations -from ._batch_deployments_operations import BatchDeploymentsOperations -from ._capability_hosts_operations import CapabilityHostsOperations -from ._code_containers_operations import CodeContainersOperations -from ._code_versions_operations import CodeVersionsOperations -from ._component_containers_operations import ComponentContainersOperations -from ._component_versions_operations import ComponentVersionsOperations -from ._data_containers_operations import DataContainersOperations -from ._data_versions_operations import DataVersionsOperations -from ._datastores_operations import DatastoresOperations -from ._environment_containers_operations import EnvironmentContainersOperations -from ._environment_versions_operations import EnvironmentVersionsOperations -from ._featureset_containers_operations import FeaturesetContainersOperations -from ._features_operations import FeaturesOperations -from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations -from ._inference_pools_operations import InferencePoolsOperations -from ._inference_endpoints_operations import InferenceEndpointsOperations -from ._inference_groups_operations import InferenceGroupsOperations -from ._jobs_operations import JobsOperations -from ._marketplace_subscriptions_operations import MarketplaceSubscriptionsOperations -from ._model_containers_operations import ModelContainersOperations -from ._model_versions_operations import ModelVersionsOperations -from ._online_endpoints_operations import OnlineEndpointsOperations -from ._online_deployments_operations import OnlineDeploymentsOperations -from ._schedules_operations import SchedulesOperations -from ._serverless_endpoints_operations import ServerlessEndpointsOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._connection_operations import ConnectionOperations -from ._connection_rai_blocklists_operations import ConnectionRaiBlocklistsOperations -from ._connection_rai_blocklist_operations import ConnectionRaiBlocklistOperations -from ._connection_rai_blocklist_item_operations import ConnectionRaiBlocklistItemOperations -from ._connection_rai_blocklist_items_operations import ConnectionRaiBlocklistItemsOperations -from ._connection_rai_policies_operations import ConnectionRaiPoliciesOperations -from ._connection_rai_policy_operations import ConnectionRaiPolicyOperations -from ._endpoint_deployment_operations import EndpointDeploymentOperations -from ._endpoint_operations import EndpointOperations -from ._rai_policies_operations import RaiPoliciesOperations -from ._rai_policy_operations import RaiPolicyOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations - -__all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'PTUQuotaOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryDataReferencesOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CapabilityHostsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'InferencePoolsOperations', - 'InferenceEndpointsOperations', - 'InferenceGroupsOperations', - 'JobsOperations', - 'MarketplaceSubscriptionsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'ServerlessEndpointsOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ConnectionOperations', - 'ConnectionRaiBlocklistsOperations', - 'ConnectionRaiBlocklistOperations', - 'ConnectionRaiBlocklistItemOperations', - 'ConnectionRaiBlocklistItemsOperations', - 'ConnectionRaiPoliciesOperations', - 'ConnectionRaiPolicyOperations', - 'EndpointDeploymentOperations', - 'EndpointOperations', - 'RaiPoliciesOperations', - 'RaiPolicyOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 4dd27c2c16fd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,876 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchDeploymentsOperations(object): - """BatchDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference deployment identifier. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - """Gets a batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.BatchDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchDeployment"] - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch inference deployment. - :type deployment_name: str - :param body: Batch inference deployment definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index e80caae8da88..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,934 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class BatchEndpointsOperations(object): - """BatchEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - """Gets a batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'BatchEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.BatchEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BatchEndpoint"] - """Creates a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Name for the Batch inference endpoint. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. - :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either BatchEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_capability_hosts_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_capability_hosts_operations.py deleted file mode 100644 index f83459f19b2a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_capability_hosts_operations.py +++ /dev/null @@ -1,504 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CapabilityHostsOperations(object): - """CapabilityHostsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete capabilityHost. - - Delete capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: CapabilityHost name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CapabilityHost" - """Get capabilityHost. - - Get capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: CapabilityHost name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CapabilityHost, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CapabilityHost - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CapabilityHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CapabilityHost" - **kwargs # type: Any - ): - # type: (...) -> "_models.CapabilityHost" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CapabilityHost') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CapabilityHost', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CapabilityHost', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CapabilityHost" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CapabilityHost"] - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: CapabilityHost name. - :type name: str - :param body: CapabilityHost definition. - :type body: ~azure.mgmt.machinelearningservices.models.CapabilityHost - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CapabilityHost or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CapabilityHost] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CapabilityHost', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index aeb371a5121e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,511 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeContainersOperations(object): - """CodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index 2cd842d46573..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,873 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - hash = kwargs.pop('hash', None) # type: Optional[str] - hash_version = kwargs.pop('hash_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if hash is not None: - _query_parameters['hash'] = _SERIALIZER.query("hash", hash, 'str') - if hash_version is not None: - _query_parameters['hashVersion'] = _SERIALIZER.query("hash_version", hash_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class CodeVersionsOperations(object): - """CodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - hash=None, # type: Optional[str] - hash_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. - :type hash: str - :param hash_version: Hash algorithm version when listing by hash. - :type hash_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index f6cb8e1f4f3c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentContainersOperations(object): - """ComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 73d490e265e4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,743 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentVersionsOperations(object): - """ComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Component name. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_compute_operations.py deleted file mode 100644 index ae989c732128..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,2101 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - underlying_resource_action = kwargs.pop('underlying_resource_action') # type: Union[str, "_models.UnderlyingResourceAction"] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - _query_parameters['underlyingResourceAction'] = _SERIALIZER.query("underlying_resource_action", underlying_resource_action, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_custom_services_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_nodes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_data_mounts_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_start_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_stop_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_restart_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_idle_shutdown_setting_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_allowed_resize_sizes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_resize_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str', pattern=r'^[a-zA-Z](?![a-zA-Z0-9-]*-\d+$)[a-zA-Z0-9\-]{2,23}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComputeOperations(object): # pylint: disable=too-many-public-methods - """ComputeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PaginatedComputeResourcesList"] - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PaginatedComputeResourcesList or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - - @distributed_trace - def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - custom_services, # type: List["_models.CustomService"] - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param custom_services: New list of Custom Services. - :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(custom_services, '[CustomService]') - - request = build_update_custom_services_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_custom_services.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - - - @distributed_trace - def list_nodes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlComputeNodesInformation"] - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AmlComputeNodesInformation or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeSecrets" - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - - - @distributed_trace - def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - data_mounts, # type: List["_models.ComputeInstanceDataMount"] - **kwargs # type: Any - ): - # type: (...) -> None - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - :type data_mounts: list[~azure.mgmt.machinelearningservices.models.ComputeInstanceDataMount] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(data_mounts, '[ComputeInstanceDataMount]') - - request = build_update_data_mounts_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_data_mounts.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_data_mounts.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts"} # type: ignore - - - def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - - @distributed_trace - def begin_start( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - - def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - - @distributed_trace - def begin_stop( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - - def _restart_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - - @distributed_trace - def begin_restart( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - - @distributed_trace - def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.IdleShutdownSetting" - **kwargs # type: Any - ): - # type: (...) -> None - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'IdleShutdownSetting') - - request = build_update_idle_shutdown_setting_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - - - @distributed_trace - def get_allowed_resize_sizes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_allowed_resize_sizes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - template_url=self.get_allowed_resize_sizes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_allowed_resize_sizes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize"} # type: ignore - - - def _resize_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ResizeSchema') - - request = build_resize_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._resize_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resize_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore - - - @distributed_trace - def begin_resize( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ResizeSchema" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - :type parameters: ~azure.mgmt.machinelearningservices.models.ResizeSchema - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resize.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_operations.py deleted file mode 100644 index f68e16f2e01a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_operations.py +++ /dev/null @@ -1,920 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_deployments_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_deployment_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_deployment_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_deployment_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_all_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionOperations(object): - """ConnectionOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_deployments( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list_deployments.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_deployments_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_deployments.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments"} # type: ignore - - def _delete_deployment_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete_deployment( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_deployment( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_deployment_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get_deployment.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - def _create_or_update_deployment_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_deployment_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_or_update_deployment_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_deployment_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update_deployment( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"] - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update_deployment.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointModels"] - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models"} # type: ignore - - @distributed_trace - def get_all_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointModels" - """Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointModels, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointModels - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_all_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get_all_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointModels', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_all_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_item_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_item_operations.py deleted file mode 100644 index 73573c782579..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_item_operations.py +++ /dev/null @@ -1,938 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_add_bulk_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_bulk_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistItemOperations(object): - """ConnectionRaiBlocklistItemOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _add_bulk_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: List["_models.RaiBlocklistItemBulkRequest"] - **kwargs # type: Any - ): - # type: (...) -> Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.RaiBlocklistItemPropertiesBasicResource"]]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, '[RaiBlocklistItemBulkRequest]') - - request = build_add_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._add_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _add_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - - @distributed_trace - def begin_add_bulk( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: List["_models.RaiBlocklistItemBulkRequest"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. - :type body: list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemBulkRequest] - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either list of - RaiBlocklistItemPropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[list[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource]] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.RaiBlocklistItemPropertiesBasicResource"]] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._add_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('[RaiBlocklistItemPropertiesBasicResource]', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_add_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems"} # type: ignore - - def _delete_bulk_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_delete_bulk_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._delete_bulk_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_bulk_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - - @distributed_trace - def begin_delete_bulk( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. - :type body: any - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete_bulk.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistItemPropertiesBasicResource" - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistItemPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - body, # type: "_models.RaiBlocklistItemPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistItemPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistItemPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - rai_blocklist_item_name, # type: str - body, # type: "_models.RaiBlocklistItemPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiBlocklistItemPropertiesBasicResource"] - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. - :type rai_blocklist_item_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiBlocklistItemPropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistItemPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_items_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_items_operations.py deleted file mode 100644 index 2b1203481efb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_items_operations.py +++ /dev/null @@ -1,200 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistItemsOperations(object): - """ConnectionRaiBlocklistItemsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_operations.py deleted file mode 100644 index 0a7b08425272..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklist_operations.py +++ /dev/null @@ -1,539 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistOperations(object): - """ConnectionRaiBlocklistOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistPropertiesBasicResource" - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiBlocklistPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: "_models.RaiBlocklistPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiBlocklistPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiBlocklistPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_blocklist_name, # type: str - body, # type: "_models.RaiBlocklistPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiBlocklistPropertiesBasicResource"] - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. - :type rai_blocklist_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiBlocklistPropertiesBasicResource or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiBlocklistPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklists_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklists_operations.py deleted file mode 100644 index e065d70a2429..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_blocklists_operations.py +++ /dev/null @@ -1,193 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiBlocklistsOperations(object): - """ConnectionRaiBlocklistsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - RaiBlocklistPropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiBlocklistPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiBlocklistPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policies_operations.py deleted file mode 100644 index 5fa5f21b789b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policies_operations.py +++ /dev/null @@ -1,193 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiPoliciesOperations(object): - """ConnectionRaiPoliciesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policy_operations.py deleted file mode 100644 index 342c926e72b9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_connection_rai_policy_operations.py +++ /dev/null @@ -1,539 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConnectionRaiPolicyOperations(object): - """ConnectionRaiPolicyOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiPolicyPropertiesBasicResource"] - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiPolicyPropertiesBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index 8aa1733f267b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataContainersOperations(object): - """DataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index becd3f612652..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,755 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DataVersionsOperations(object): - """DataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 925b31bade62..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,684 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', 30) # type: Optional[int] - is_default = kwargs.pop('is_default', None) # type: Optional[bool] - names = kwargs.pop('names', None) # type: Optional[List[str]] - search_text = kwargs.pop('search_text', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - order_by_asc = kwargs.pop('order_by_asc', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if is_default is not None: - _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') - if names is not None: - _query_parameters['names'] = _SERIALIZER.query("names", names, '[str]', div=',') - if search_text is not None: - _query_parameters['searchText'] = _SERIALIZER.query("search_text", search_text, 'str') - if order_by is not None: - _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if order_by_asc is not None: - _query_parameters['orderByAsc'] = _SERIALIZER.query("order_by_asc", order_by_asc, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - skip_validation = kwargs.pop('skip_validation', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip_validation is not None: - _query_parameters['skipValidation'] = _SERIALIZER.query("skip_validation", skip_validation, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class DatastoresOperations(object): - """DatastoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=30, # type: Optional[int] - is_default=None, # type: Optional[bool] - names=None, # type: Optional[List[str]] - search_text=None, # type: Optional[str] - order_by=None, # type: Optional[str] - order_by_asc=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DatastoreResourceArmPaginatedResult"] - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param is_default: Filter down to the workspace default datastore. - :type is_default: bool - :param names: Names of datastores to return. - :type names: list[str] - :param search_text: Text to search for in the datastore names. - :type search_text: str - :param order_by: Order by property (createdtime | modifiedtime | name). - :type order_by: str - :param order_by_asc: Order by property in ascending order. - :type order_by_asc: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Datastore" - skip_validation=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.Datastore" - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Datastore entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.Datastore - :param skip_validation: Flag to skip validation. - :type skip_validation: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Datastore, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Datastore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Datastore') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body=None, # type: Optional["_models.SecretExpiry"] - **kwargs # type: Any - ): - # type: (...) -> "_models.DatastoreSecrets" - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Datastore name. - :type name: str - :param body: Secret expiry information. - :type body: ~azure.mgmt.machinelearningservices.models.SecretExpiry - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DatastoreSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'SecretExpiry') - else: - _json = None - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_deployment_operations.py deleted file mode 100644 index a32070c1ddcc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_deployment_operations.py +++ /dev/null @@ -1,810 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_in_workspace_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointDeploymentOperations(object): - """EndpointDeploymentOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_in_workspace( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=self.get_in_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_in_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_in_workspace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointDeploymentResourcePropertiesBasicResource" - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointDeploymentResourcePropertiesBasicResource, or the result of cls(response) - :rtype: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointDeploymentResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointDeploymentResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.EndpointDeploymentResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointDeploymentResourcePropertiesBasicResource"] - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. - :type deployment_name: str - :param body: deployment object. - :type body: - ~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - EndpointDeploymentResourcePropertiesBasicResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointDeploymentResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointDeploymentResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_operations.py deleted file mode 100644 index a58275daa5d6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_endpoint_operations.py +++ /dev/null @@ -1,867 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - endpoint_type = kwargs.pop('endpoint_type', None) # type: Optional[Union[str, "_models.EndpointType"]] - include_online_endpoints = kwargs.pop('include_online_endpoints', False) # type: Optional[bool] - include_serverless_endpoints = kwargs.pop('include_serverless_endpoints', False) # type: Optional[bool] - include_connections = kwargs.pop('include_connections', False) # type: Optional[bool] - skip = kwargs.pop('skip', None) # type: Optional[str] - expand = kwargs.pop('expand', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if endpoint_type is not None: - _query_parameters['endpointType'] = _SERIALIZER.query("endpoint_type", endpoint_type, 'str') - if include_online_endpoints is not None: - _query_parameters['includeOnlineEndpoints'] = _SERIALIZER.query("include_online_endpoints", include_online_endpoints, 'bool') - if include_serverless_endpoints is not None: - _query_parameters['includeServerlessEndpoints'] = _SERIALIZER.query("include_serverless_endpoints", include_serverless_endpoints, 'bool') - if include_connections is not None: - _query_parameters['includeConnections'] = _SERIALIZER.query("include_connections", include_connections, 'bool') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if expand is not None: - _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_models_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EndpointOperations(object): - """EndpointOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_type=None, # type: Optional[Union[str, "_models.EndpointType"]] - include_online_endpoints=False, # type: Optional[bool] - include_serverless_endpoints=False, # type: Optional[bool] - include_connections=False, # type: Optional[bool] - skip=None, # type: Optional[str] - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_type: Endpoint type filter. - :type endpoint_type: str or ~azure.mgmt.machinelearningservices.models.EndpointType - :param include_online_endpoints: - :type include_online_endpoints: bool - :param include_serverless_endpoints: - :type include_serverless_endpoints: bool - :param include_connections: - :type include_connections: bool - :param skip: Continuation token for pagination. - :type skip: str - :param expand: Whether the endpoint resource will be expand to include deployment information, - e.g. $expand=deployments. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - EndpointResourcePropertiesBasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_online_endpoints=include_online_endpoints, - include_serverless_endpoints=include_serverless_endpoints, - include_connections=include_connections, - skip=skip, - expand=expand, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - endpoint_type=endpoint_type, - include_online_endpoints=include_online_endpoints, - include_serverless_endpoints=include_serverless_endpoints, - include_connections=include_connections, - skip=skip, - expand=expand, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointResourcePropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointResourcePropertiesBasicResource" - """Gets endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointResourcePropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointResourcePropertiesBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointResourcePropertiesBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EndpointResourcePropertiesBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.EndpointResourcePropertiesBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointResourcePropertiesBasicResource"] - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: Endpoint resource object. - :type body: ~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointResourcePropertiesBasicResource - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointResourcePropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointResourcePropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointResourcePropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointKeys" - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys"} # type: ignore - - - @distributed_trace - def get_models( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointModels"] - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointModels or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EndpointModels] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointModels"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_models.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_models_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointModels", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get_models.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models"} # type: ignore - - @distributed_trace - def regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateServiceAccountKeyContent" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountApiKeys" - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateServiceAccountKeyContent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountApiKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AccountApiKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountApiKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateServiceAccountKeyContent') - - request = build_regenerate_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.regenerate_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountApiKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index 75573018ccf5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_containers_operations.py +++ /dev/null @@ -1,519 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentContainersOperations(object): - """EnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 1061222eeaa4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,743 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class EnvironmentVersionsOperations(object): - """EnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of EnvironmentVersion. This is case-sensitive. - :type name: str - :param version: Version of EnvironmentVersion. - :type version: str - :param body: Definition of EnvironmentVersion. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_features_operations.py deleted file mode 100644 index 105a90c2044d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_features_operations.py +++ /dev/null @@ -1,359 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - feature_name = kwargs.pop('feature_name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 1000) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if feature_name is not None: - _query_parameters['featureName'] = _SERIALIZER.query("feature_name", feature_name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, 'str'), - "featureName": _SERIALIZER.url("feature_name", feature_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesOperations(object): - """FeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - feature_name=None, # type: Optional[str] - description=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=1000, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeatureResourceArmPaginatedResult"] - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Featureset name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Featureset Version identifier. This is case-sensitive. - :type featureset_version: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param feature_name: feature name. - :type feature_name: str - :param description: Description of the featureset. - :type description: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: Page size. - :type page_size: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - api_version=api_version, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - featureset_name, # type: str - featureset_version, # type: str - feature_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Feature" - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param featureset_name: Feature set name. This is case-sensitive. - :type featureset_name: str - :param featureset_version: Feature set version identifier. This is case-sensitive. - :type featureset_version: str - :param feature_name: Feature Name. This is case-sensitive. - :type feature_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Feature, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Feature - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Feature', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index 0e7727ed9ac0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetContainersOperations(object): - """FeaturesetContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featureset. - :type name: str - :param description: description for the feature set. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturesetContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index 291f7ca0309c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,924 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_backfill_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturesetVersionsOperations(object): - """FeaturesetVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Featureset name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featureset version. - :type version_name: str - :param version: featureset version. - :type version: str - :param description: description for the feature set version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturesetVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - - def _backfill_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.FeaturesetVersionBackfillResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') - - request = build_backfill_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._backfill_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - - - @distributed_trace - def begin_backfill( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturesetVersionBackfillRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturesetVersionBackfillResponse"] - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Feature set version backfill request entity. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturesetVersionBackfillResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersionBackfillResponse', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 5e7544aa300e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - name = kwargs.pop('name', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_entity_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityContainersOperations(object): - """FeaturestoreEntityContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - name=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param name: name for the featurestore entity. - :type name: str - :param description: description for the featurestore entity. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityContainerResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - @distributed_trace - def get_entity( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_entity_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get_entity.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.FeaturestoreEntityContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityContainer or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index e7f7f3e43a62..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - page_size = kwargs.pop('page_size', 20) # type: Optional[int] - version_name = kwargs.pop('version_name', None) # type: Optional[str] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - created_by = kwargs.pop('created_by', None) # type: Optional[str] - stage = kwargs.pop('stage', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if page_size is not None: - _query_parameters['pageSize'] = _SERIALIZER.query("page_size", page_size, 'int') - if version_name is not None: - _query_parameters['versionName'] = _SERIALIZER.query("version_name", version_name, 'str') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if created_by is not None: - _query_parameters['createdBy'] = _SERIALIZER.query("created_by", created_by, 'str') - if stage is not None: - _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class FeaturestoreEntityVersionsOperations(object): - """FeaturestoreEntityVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - page_size=20, # type: Optional[int] - version_name=None, # type: Optional[str] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - created_by=None, # type: Optional[str] - stage=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Feature entity name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param page_size: page size. - :type page_size: int - :param version_name: name for the featurestore entity version. - :type version_name: str - :param version: featurestore entity version. - :type version: str - :param description: description for the feature entity version. - :type description: str - :param created_by: createdBy user name. - :type created_by: str - :param stage: Specifies the featurestore stage. - :type stage: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - FeaturestoreEntityVersionResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FeaturestoreEntityVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.FeaturestoreEntityVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FeaturestoreEntityVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either FeaturestoreEntityVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_endpoints_operations.py deleted file mode 100644 index 9a48b162a976..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_endpoints_operations.py +++ /dev/null @@ -1,894 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceEndpointsOperations(object): - """InferenceEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceEndpoint to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceEndpointTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'object') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: any - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - endpoint_name, # type: str - body, # type: "_models.InferenceEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceEndpoint"] - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param endpoint_name: InferenceEndpoint name. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_groups_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_groups_operations.py deleted file mode 100644 index 8096c651f676..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_groups_operations.py +++ /dev/null @@ -1,1611 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_delta_models_status_async_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/getStatus") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_delta_models_async_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/list") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_modify_delta_models_async_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/modify") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_status_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "groupName": _SERIALIZER.url("group_name", group_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferenceGroupsOperations(object): - """InferenceGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Name of the InferencePool. - :type pool_name: str - :param count: Number of InferenceGroup to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferenceGroupTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferenceGroupTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroupTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferenceGroupTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferenceGroup, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferenceGroup"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferenceGroup"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferenceGroup" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferenceGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferenceGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.InferenceGroup" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferenceGroup"] - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferenceGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferenceGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferenceGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferenceGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferenceGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}"} # type: ignore - - @distributed_trace - def get_delta_models_status_async( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.DeltaModelStatusRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeltaModelStatusResponse" - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: DeltaModelBaseRequest. - :type body: ~azure.mgmt.machinelearningservices.models.DeltaModelStatusRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeltaModelStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeltaModelStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeltaModelStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeltaModelStatusRequest') - - request = build_get_delta_models_status_async_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_delta_models_status_async.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeltaModelStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_delta_models_status_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/getStatus"} # type: ignore - - - @distributed_trace - def list_delta_models_async( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.DeltaModelListRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.StringArmPaginatedResult"] - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: DeltaModelBaseRequest. - :type body: ~azure.mgmt.machinelearningservices.models.DeltaModelListRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StringArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.StringArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - cls = kwargs.pop('cls', None) # type: ClsType["_models.StringArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - _json = self._serialize.body(body, 'DeltaModelListRequest') - - request = build_list_delta_models_async_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.list_delta_models_async.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - _json = self._serialize.body(body, 'DeltaModelListRequest') - - request = build_list_delta_models_async_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("StringArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_delta_models_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/list"} # type: ignore - - def _modify_delta_models_async_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.DeltaModelModifyRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeltaModelModifyRequest') - - request = build_modify_delta_models_async_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._modify_delta_models_async_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _modify_delta_models_async_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/modify"} # type: ignore - - - @distributed_trace - def begin_modify_delta_models_async( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - body, # type: "_models.DeltaModelModifyRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :param body: DeltaModelModifyRequest. - :type body: ~azure.mgmt.machinelearningservices.models.DeltaModelModifyRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._modify_delta_models_async_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_modify_delta_models_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/modify"} # type: ignore - - @distributed_trace - def get_status( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.GroupStatus" - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: InferencePool name. - :type pool_name: str - :param group_name: InferenceGroup name. - :type group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GroupStatus, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GroupStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_status_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - template_url=self.get_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GroupStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_status.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - pool_name, # type: str - group_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param pool_name: Inference Pool name. - :type pool_name: str - :param group_name: Inference Group name. - :type group_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_pools_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_pools_operations.py deleted file mode 100644 index 9b83880c71f6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_inference_pools_operations.py +++ /dev/null @@ -1,856 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class InferencePoolsOperations(object): - """InferencePoolsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InferencePoolTrackedResourceArmPaginatedResult"] - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param count: Number of inferencePools to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InferencePoolTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.InferencePoolTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePoolTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InferencePoolTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InferencePool, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.InferencePool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.InferencePool"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.InferencePool"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> "_models.InferencePool" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'InferencePool') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('InferencePool', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('InferencePool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - inference_pool_name, # type: str - body, # type: "_models.InferencePool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InferencePool"] - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.InferencePool - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InferencePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.InferencePool] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InferencePool"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('InferencePool', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 26de093ee52e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,766 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - job_type = kwargs.pop('job_type', None) # type: Optional[str] - tag = kwargs.pop('tag', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - properties = kwargs.pop('properties', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if job_type is not None: - _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') - if tag is not None: - _query_parameters['tag'] = _SERIALIZER.query("tag", tag, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_cancel_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "id": _SERIALIZER.url("id", id, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - job_type=None, # type: Optional[str] - tag=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - properties=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobBaseResourceArmPaginatedResult"] - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param job_type: Type of job to be returned. - :type job_type: str - :param tag: Jobs returned will have this tag key. - :type tag: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :param properties: Comma-separated list of user property names (and optionally values). - Example: prop1,prop2=value2. - :type properties: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.JobBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - Creates and executes a Job. - For update case, the Tags in the definition passed in will replace Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :param body: Job definition object. - :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword callable cls: A custom type or function that will be passed the direct response - :return: JobBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.JobBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'JobBase') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - - - def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_cancel_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - template_url=self._cancel_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - - - @distributed_trace - def begin_cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index e956d8514eb9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,234 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_provision_managed_network_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkProvisionsOperations(object): - """ManagedNetworkProvisionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _provision_managed_network_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') - else: - _json = None - - request = build_provision_managed_network_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - - - @distributed_trace - def begin_provision_managed_network( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedNetworkProvisionStatus"] - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ManagedNetworkProvisionStatus or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index df169720cc0c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,629 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "ruleName": _SERIALIZER.url("rule_name", rule_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ManagedNetworkSettingsRuleOperations(object): - """ManagedNetworkSettingsRuleOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundRuleListResult"] - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundRuleListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OutboundRuleBasicResource" - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OutboundRuleBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OutboundRuleBasicResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - rule_name, # type: str - body, # type: "_models.OutboundRuleBasicResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OutboundRuleBasicResource"] - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OutboundRuleBasicResource or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_marketplace_subscriptions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_marketplace_subscriptions_operations.py deleted file mode 100644 index 813a69e5e59b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_marketplace_subscriptions_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class MarketplaceSubscriptionsOperations(object): - """MarketplaceSubscriptionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MarketplaceSubscriptionResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.MarketplaceSubscriptionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscriptionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MarketplaceSubscriptionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: MarketplaceSubscription, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> "_models.MarketplaceSubscription" - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'MarketplaceSubscription') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.MarketplaceSubscription" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MarketplaceSubscription"] - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Marketplace Subscription name. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.MarketplaceSubscription - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either MarketplaceSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.MarketplaceSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplaceSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('MarketplaceSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 0c99065dd919..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelContainersOperations(object): - """ModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - count=None, # type: Optional[int] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param count: Maximum number of results to return. - :type count: int - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - count=count, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index fbe9f5b5c420..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,793 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - offset = kwargs.pop('offset', None) # type: Optional[int] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - feed = kwargs.pop('feed', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if offset is not None: - _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if feed is not None: - _query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_publish_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ModelVersionsOperations(object): - """ModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - offset=None, # type: Optional[int] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - feed=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Model name. This is case-sensitive. - :type name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Model version. - :type version: str - :param description: Model description. - :type description: str - :param offset: Number of initial results to skip. - :type offset: int - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param feed: Name of the feed. - :type feed: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - - - def _publish_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DestinationAsset') - - request = build_publish_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._publish_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _publish_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore - - - @distributed_trace - def begin_publish( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DestinationAsset" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Destination registry info. - :type body: ~azure.mgmt.machinelearningservices.models.DestinationAsset - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_publish.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 57cb518fe1d3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1150 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_logs_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_skus_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - count = kwargs.pop('count', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineDeploymentsOperations(object): - """OnlineDeploymentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Top of list. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineDeployment, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSku" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineDeployment') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.OnlineDeployment" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineDeployment"] - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineDeployment or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - - @distributed_trace - def get_logs( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - body, # type: "_models.DeploymentLogsRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.DeploymentLogs" - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: The name and identifier for the endpoint. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. - :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeploymentLogs, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DeploymentLogsRequest') - - request = build_get_logs_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_logs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeploymentLogs', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - - - @distributed_trace - def list_skus( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - deployment_name, # type: str - count=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuResourceArmPaginatedResult"] - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Inference endpoint name. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. - :type deployment_name: str - :param count: Number of Skus to be retrieved in a page of results. - :type count: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=self.list_skus.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_skus_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - api_version=api_version, - count=count, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index e3203e6f3c77..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1257 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - name = kwargs.pop('name', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - compute_type = kwargs.pop('compute_type', None) # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[Union[str, "_models.OrderString"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if name is not None: - _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') - if count is not None: - _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') - if compute_type is not None: - _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if order_by is not None: - _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class OnlineEndpointsOperations(object): - """OnlineEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - name=None, # type: Optional[str] - count=None, # type: Optional[int] - compute_type=None, # type: Optional[Union[str, "_models.EndpointComputeType"]] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - order_by=None, # type: Optional[Union[str, "_models.OrderString"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Name of the endpoint. - :type name: str - :param count: Number of endpoints to be retrieved in a page of results. - :type count: int - :param compute_type: EndpointComputeType to be filtered by. - :type compute_type: str or ~azure.mgmt.machinelearningservices.models.EndpointComputeType - :param skip: Continuation token for pagination. - :type skip: str - :param tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . - :type tags: str - :param properties: A set of properties with which to filter the returned models. It is a comma - separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . - :type properties: str - :param order_by: The option to order the response. - :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OnlineEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'OnlineEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.OnlineEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OnlineEndpoint"] - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OnlineEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - - @distributed_trace - def get_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthToken" - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. - :type endpoint_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthToken, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - template_url=self.get_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_operations.py deleted file mode 100644 index c8d3e9084c04..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_operations.py +++ /dev/null @@ -1,155 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.MachineLearningServices/operations") - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 1e0796fa3e24..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,501 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - body, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - Called by end-users to approve or reject a PE connection. - This method must validate and forward the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. - :type body: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index a844632a3809..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,190 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateLinkResourceListResult"] - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. - Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. - Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. - Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResourceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_ptu_quota_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_ptu_quota_operations.py deleted file mode 100644 index cc760ba3dc55..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_ptu_quota_operations.py +++ /dev/null @@ -1,397 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_available_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_available_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota/default") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotaAndUsage") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PTUQuotaOperations(object): - """PTUQuotaOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_available( - self, - location, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableQuotaArmPaginatedResult"] - """List available MaaS PTU quota. - - List available MaaS PTU quota. - - :param location: The name of Azure region. - :type location: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AvailableQuotaArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AvailableQuotaArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableQuotaArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_available_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=self.list_available.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_available_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AvailableQuotaArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_available.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota"} # type: ignore - - @distributed_trace - def get_available( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AvailableQuota" - """Get available MaaS PTU quota. - - Get available MaaS PTU quota. - - :param location: The name of Azure region. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AvailableQuota, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.AvailableQuota - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableQuota"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_available_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.get_available.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AvailableQuota', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_available.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota/default"} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UsageAndQuotaDetailsArmPaginatedResult"] - """List MaaS PTU usage and quota. - - List MaaS PTU usage and quota. - - :param location: The name of Azure region. - :type location: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UsageAndQuotaDetailsArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.UsageAndQuotaDetailsArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageAndQuotaDetailsArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("UsageAndQuotaDetailsArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotaAndUsage"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_quotas_operations.py deleted file mode 100644 index efde97286a58..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_update_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas") # pylint: disable=line-too-long - path_format_arguments = { - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class QuotasOperations(object): - """QuotasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def update( - self, - location, # type: str - parameters, # type: "_models.QuotaUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateWorkspaceQuotasResult" - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateWorkspaceQuotasResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListWorkspaceQuotas"] - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policies_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policies_operations.py deleted file mode 100644 index 4600f9a7fe71..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policies_operations.py +++ /dev/null @@ -1,193 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RaiPoliciesOperations(object): - """RaiPoliciesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RaiPolicyPropertiesBasicResourceArmPaginatedResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RaiPolicyPropertiesBasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policy_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policy_operations.py deleted file mode 100644 index a77edb5160ff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_rai_policy_operations.py +++ /dev/null @@ -1,539 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - proxy_api_version = kwargs.pop('proxy_api_version', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,32}$'), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if proxy_api_version is not None: - _query_parameters['proxy-api-version'] = _SERIALIZER.query("proxy_api_version", proxy_api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RaiPolicyOperations(object): - """RaiPolicyOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - proxy_api_version=proxy_api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RaiPolicyPropertiesBasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - def _create_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.RaiPolicyPropertiesBasicResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RaiPolicyPropertiesBasicResource') - - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - proxy_api_version=proxy_api_version, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore - - - @distributed_trace - def begin_create( - self, - resource_group_name, # type: str - workspace_name, # type: str - endpoint_name, # type: str - rai_policy_name, # type: str - body, # type: "_models.RaiPolicyPropertiesBasicResource" - proxy_api_version=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RaiPolicyPropertiesBasicResource"] - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. - :type rai_policy_name: str - :param body: - :type body: ~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource - :param proxy_api_version: Api version used by proxy call. - :type proxy_api_version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RaiPolicyPropertiesBasicResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.RaiPolicyPropertiesBasicResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RaiPolicyPropertiesBasicResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('RaiPolicyPropertiesBasicResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registries_operations.py deleted file mode 100644 index 82d9e5d68c9d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,988 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_remove_regions_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistriesOperations(object): - """RegistriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - @distributed_trace - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Registry, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Registry - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - def _remove_regions_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Registry') - - request = build_remove_regions_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._remove_regions_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - - - @distributed_trace - def begin_remove_regions( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.Registry" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Registry"] - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param body: Details required to create the registry. - :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Registry or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 9fd0fd4bdcae..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,636 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeContainersOperations(object): - """RegistryCodeContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - body, # type: "_models.CodeContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeContainer"] - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index 56834f4022d1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,802 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "codeName": _SERIALIZER.url("code_name", code_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryCodeVersionsOperations(object): - """RegistryCodeVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.CodeVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CodeVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'CodeVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.CodeVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.CodeVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Container name. - :type code_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CodeVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - code_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param code_name: Pending upload name. This is case-sensitive. - :type code_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index b32bf413a96e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,637 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentContainersOperations(object): - """RegistryComponentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentContainerResourceArmPaginatedResult"] - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - body, # type: "_models.ComponentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index 4baaff5d2253..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,682 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryComponentVersionsOperations(object): - """RegistryComponentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ComponentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - component_name, # type: str - version, # type: str - body, # type: "_models.ComponentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComponentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param component_name: Container name. - :type component_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComponentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index 54710cdb34e8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,644 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataContainersOperations(object): - """RegistryDataContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataContainerResourceArmPaginatedResult"] - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - body, # type: "_models.DataContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataContainer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_references_operations.py deleted file mode 100644 index f39ad9e84156..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_references_operations.py +++ /dev/null @@ -1,174 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_blob_reference_sas_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataReferencesOperations(object): - """RegistryDataReferencesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_blob_reference_sas( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.GetBlobReferenceSASRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.GetBlobReferenceSASResponseDto" - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data reference name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Asset id and blob uri. - :type body: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetBlobReferenceSASResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.GetBlobReferenceSASResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetBlobReferenceSASResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'GetBlobReferenceSASRequestDto') - - request = build_get_blob_reference_sas_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.get_blob_reference_sas.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('GetBlobReferenceSASResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_blob_reference_sas.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index 21b0baf4f2b3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,823 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if tags is not None: - _query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryDataVersionsOperations(object): - """RegistryDataVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DataVersionBaseResourceArmPaginatedResult"] - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data container's name. - :type name: str - :param order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. - :type order_by: str - :param top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count - will be returned. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataVersionBase, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'DataVersionBase') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.DataVersionBase" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DataVersionBase"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Container name. - :type name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DataVersionBase or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param name: Data asset name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 03c5149dfb4b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentContainersOperations(object): - """RegistryEnvironmentContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentContainerResourceArmPaginatedResult"] - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - body, # type: "_models.EnvironmentContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentContainer"] - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 972d9c7bd793..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "environmentName": _SERIALIZER.url("environment_name", environment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryEnvironmentVersionsOperations(object): - """RegistryEnvironmentVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EnvironmentVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EnvironmentVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'EnvironmentVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - environment_name, # type: str - version, # type: str - body, # type: "_models.EnvironmentVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EnvironmentVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param environment_name: Container name. - :type environment_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EnvironmentVersion or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index 559cd054d6ef..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelContainersOperations(object): - """RegistryModelContainersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelContainerResourceArmPaginatedResult"] - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelContainer, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelContainer') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - body, # type: "_models.ModelContainer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelContainer"] - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param body: Container entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelContainer or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index 16d895815c95..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,844 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - order_by = kwargs.pop('order_by', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - version = kwargs.pop('version', None) # type: Optional[str] - description = kwargs.pop('description', None) # type: Optional[str] - tags = kwargs.pop('tags', None) # type: Optional[str] - properties = kwargs.pop('properties', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if order_by is not None: - _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') - if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') - if version is not None: - _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') - if description is not None: - _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') - if tags is not None: - _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - if properties is not None: - _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_get_start_pending_upload_request( - subscription_id, # type: str - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,32}$'), - "modelName": _SERIALIZER.url("model_name", model_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - "version": _SERIALIZER.url("version", version, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class RegistryModelVersionsOperations(object): - """RegistryModelVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - skip=None, # type: Optional[str] - order_by=None, # type: Optional[str] - top=None, # type: Optional[int] - version=None, # type: Optional[str] - description=None, # type: Optional[str] - tags=None, # type: Optional[str] - properties=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ModelVersionResourceArmPaginatedResult"] - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param order_by: Ordering of list. - :type order_by: str - :param top: Maximum number of records to return. - :type top: int - :param version: Version identifier. - :type version: str - :param description: Model description. - :type description: str - :param tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type tags: str - :param properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. - :type properties: str - :param list_view_type: View type for including/excluding (for example) archived entities. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - api_version=api_version, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ModelVersion, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ModelVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.ModelVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ModelVersion"] - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Container name. - :type model_name: str - :param version: Version identifier. - :type version: str - :param body: Version entity to create or update. - :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ModelVersion or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PendingUploadRequestDto" - **kwargs # type: Any - ): - # type: (...) -> "_models.PendingUploadResponseDto" - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - :type registry_name: str - :param model_name: Model name. This is case-sensitive. - :type model_name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Pending upload request object. - :type body: ~azure.mgmt.machinelearningservices.models.PendingUploadRequestDto - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PendingUploadResponseDto, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PendingUploadRequestDto') - - request = build_create_or_get_start_pending_upload_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_schedules_operations.py deleted file mode 100644 index 8ee2d562f517..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_schedules_operations.py +++ /dev/null @@ -1,643 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - list_view_type = kwargs.pop('list_view_type', None) # type: Optional[Union[str, "_models.ScheduleListViewType"]] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if list_view_type is not None: - _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SchedulesOperations(object): - """SchedulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - list_view_type=None, # type: Optional[Union[str, "_models.ScheduleListViewType"]] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ScheduleResourceArmPaginatedResult"] - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :param list_view_type: Status filter for schedule. - :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - list_view_type=list_view_type, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Schedule, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Schedule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Schedule') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.Schedule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Schedule"] - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Schedule name. - :type name: str - :param body: Schedule definition. - :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Schedule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_serverless_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_serverless_endpoints_operations.py deleted file mode 100644 index 13e721c6f6f6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_serverless_endpoints_operations.py +++ /dev/null @@ -1,1112 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z][a-zA-Z0-9-]{0,51}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_regenerate_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ServerlessEndpointsOperations(object): - """ServerlessEndpointsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - ServerlessEndpointTrackedResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ServerlessEndpointTrackedResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpointTrackedResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerlessEndpointTrackedResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerlessEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ServerlessEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerlessEndpoint"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSkuAndIdentity') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.PartialMinimalTrackedResourceWithSkuAndIdentity" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: - ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> "_models.ServerlessEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ServerlessEndpoint') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.ServerlessEndpoint" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ServerlessEndpoint"] - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. - :type body: ~azure.mgmt.machinelearningservices.models.ServerlessEndpoint - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ServerlessEndpoint or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ServerlessEndpoint] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerlessEndpoint"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ServerlessEndpoint', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.EndpointAuthKeys" - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EndpointAuthKeys, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys"} # type: ignore - - - def _regenerate_keys_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EndpointAuthKeys"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EndpointAuthKeys"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') - - request = build_regenerate_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore - - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - body, # type: "_models.RegenerateEndpointKeysRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EndpointAuthKeys"] - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param name: Serverless Endpoint name. - :type name: str - :param body: RegenerateKeys request . - :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either EndpointAuthKeys or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EndpointAuthKeys] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_usages_operations.py deleted file mode 100644 index fca62ad11139..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListUsagesResult"] - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListUsagesResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 9291d8802adf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes") # pylint: disable=line-too-long - path_format_arguments = { - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class VirtualMachineSizesOperations(object): - """VirtualMachineSizesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 036f76cb39ac..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,929 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - include_all = kwargs.pop('include_all', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if target is not None: - _query_parameters['target'] = _SERIALIZER.query("target", target, 'str') - if category is not None: - _query_parameters['category'] = _SERIALIZER.query("category", category, 'str') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if include_all is not None: - _query_parameters['includeAll'] = _SERIALIZER.query("include_all", include_all, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_secrets_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_test_connection_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceConnectionsOperations(object): - """WorkspaceConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - target=None, # type: Optional[str] - category=None, # type: Optional[str] - include_all=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - """Lists all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :param include_all: query parameter that indicates if get connection call should return both - connections and datastores. - :type include_all: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - target=target, - category=category, - include_all=include_all, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionUpdateParameter"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Parameters for workspace connection update. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUpdateParameter - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') - else: - _json = None - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - - - @distributed_trace - def list_secrets( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_secrets_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - template_url=self.list_secrets.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - - - def _test_connection_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') - else: - _json = None - - request = build_test_connection_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._test_connection_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _test_connection_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore - - - @distributed_trace - def begin_test_connection( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - body=None, # type: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param body: Workspace Connection object. - :type body: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_test_connection.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 31f277fcce5b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceFeaturesOperations(object): - """WorkspaceFeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListAmlUserFeatureResult"] - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListAmlUserFeatureResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index 110935de78da..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1923 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - kind = kwargs.pop('kind', None) # type: Optional[str] - skip = kwargs.pop('skip', None) # type: Optional[str] - ai_capabilities = kwargs.pop('ai_capabilities', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if ai_capabilities is not None: - _query_parameters['aiCapabilities'] = _SERIALIZER.query("ai_capabilities", ai_capabilities, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - force_to_purge = kwargs.pop('force_to_purge', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if force_to_purge is not None: - _query_parameters['forceToPurge'] = _SERIALIZER.query("force_to_purge", force_to_purge, 'bool') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_diagnose_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_notebook_access_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_notebook_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_storage_account_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_outbound_network_dependencies_endpoints_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_prepare_notebook_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_resync_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class WorkspacesOperations(object): - """WorkspacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - kind=None, # type: Optional[str] - skip=None, # type: Optional[str] - ai_capabilities=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param kind: Kind of workspace. - :type kind: str - :param skip: Continuation token for pagination. - :type skip: str - :param ai_capabilities: - :type ai_capabilities: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - force_to_purge=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param force_to_purge: Flag to indicate delete is a purge request. - :type force_to_purge: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Workspace" - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - body, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. - :type body: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - def _diagnose_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - - @distributed_trace - def begin_diagnose( - self, - resource_group_name, # type: str - workspace_name, # type: str - body=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DiagnoseResponseResult"] - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. - :type body: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiagnoseResponseResult or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListWorkspaceKeysResult" - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListWorkspaceKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - - - @distributed_trace - def list_notebook_access_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NotebookAccessTokenResult" - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NotebookAccessTokenResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - - - @distributed_trace - def list_notebook_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListNotebookKeysResult" - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListNotebookKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - - - @distributed_trace - def list_storage_account_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListStorageAccountKeysResult" - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListStorageAccountKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - - - @distributed_trace - def list_outbound_network_dependencies_endpoints( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExternalFQDNResponse" - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalFQDNResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - - - def _prepare_notebook_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - - @distributed_trace - def begin_prepare_notebook( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NotebookResourceInfo"] - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - - def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - - - @distributed_trace - def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2025-01-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2025_01_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py index da06208ff8aa..82186a7821a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py @@ -11,8 +11,8 @@ from marshmallow import INCLUDE, Schema -from azure.ai.ml._restclient.v2025_01_01_preview.models import CommandJob as RestCommandJob -from azure.ai.ml._restclient.v2025_01_01_preview.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import CommandJob as RestCommandJob +from azure.ai.ml._restclient.arm_ml_service.models import JobBase from azure.ai.ml._schema.core.fields import ExperimentalField, NestedField, UnionField from azure.ai.ml._schema.job.command_job import CommandJobSchema from azure.ai.ml._schema.job.identity import AMLTokenIdentitySchema, ManagedIdentitySchema, UserIdentitySchema diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py index cfa9cccc9d50..2bdf2bf36571 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py @@ -9,8 +9,8 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2025_01_01_preview.models import CommandJob as RestCommandJob -from azure.ai.ml._restclient.v2025_01_01_preview.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import CommandJob as RestCommandJob +from azure.ai.ml._restclient.arm_ml_service.models import JobBase from azure.ai.ml._schema.job.command_job import CommandJobSchema from azure.ai.ml._utils.utils import map_single_brackets_and_warn from azure.ai.ml.constants import JobType @@ -175,8 +175,11 @@ def _to_rest_object(self) -> JobBase: limits=self.limits._to_rest_object() if self.limits else None, services=JobServiceBase._to_rest_job_services(self.services), queue_settings=self.queue_settings._to_rest_object() if self.queue_settings else None, - parent_job_name=self.parent_job_name, ) + # parentJobName is part of the 2025-01-01-preview wire contract but is not a constructor + # field on the shared arm_ml_service CommandJob model, so set it on the wire directly. + if self.parent_job_name is not None: + properties["parentJobName"] = self.parent_job_name result = JobBase(properties=properties) result.name = self.name return result @@ -218,7 +221,7 @@ def _load_from_rest(cls, obj: JobBase) -> "CommandJob": inputs=from_rest_inputs_to_dataset_literal(rest_command_job.inputs), outputs=from_rest_data_outputs(rest_command_job.outputs), queue_settings=QueueSettings._from_rest_object(rest_command_job.queue_settings), - parent_job_name=rest_command_job.parent_job_name, + parent_job_name=rest_command_job.get("parentJobName"), ) # Handle special case of local job if ( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py index 664be444de0e..f8218c487c75 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py @@ -6,10 +6,8 @@ import logging from typing import Any, Dict, List, Optional, Union, cast +from azure.ai.ml._restclient.arm_ml_service.models import JobResourceConfiguration as RestJobResourceConfiguration202501 from azure.ai.ml._restclient.v2023_04_01_preview.models import JobResourceConfiguration as RestJobResourceConfiguration -from azure.ai.ml._restclient.v2025_01_01_preview.models import ( - JobResourceConfiguration as RestJobResourceConfiguration202501, -) from azure.ai.ml.constants._job.job import JobComputePropertyFields from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin from azure.ai.ml.entities._util import convert_ordered_dict_to_dict @@ -165,14 +163,18 @@ def properties(self, properties: Optional[Dict[str, Any]]) -> None: def _to_rest_object(self) -> Union[RestJobResourceConfiguration, RestJobResourceConfiguration202501]: if self.docker_args and isinstance(self.docker_args, list): - return RestJobResourceConfiguration202501( + rest_obj = RestJobResourceConfiguration202501( instance_count=self.instance_count, instance_type=self.instance_type, - max_instance_count=self.max_instance_count, properties=self.properties.as_dict() if isinstance(self.properties, Properties) else None, docker_args_list=self.docker_args, shm_size=self.shm_size, ) + # maxInstanceCount is part of the service wire contract but is not a constructor field + # on the shared arm_ml_service JobResourceConfiguration model, so set it on the wire directly. + if self.max_instance_count is not None: + rest_obj["maxInstanceCount"] = self.max_instance_count + return rest_obj return RestJobResourceConfiguration( locations=self.locations, instance_count=self.instance_count, @@ -195,7 +197,12 @@ def _from_rest_object( locations=obj.locations if hasattr(obj, "locations") else None, instance_count=obj.instance_count, instance_type=obj.instance_type, - max_instance_count=obj.max_instance_count if hasattr(obj, "max_instance_count") else None, + # maxInstanceCount is a real service field. The msrest model (v2023_04) exposes it as an + # attribute; the shared arm_ml_service hybrid model does not declare it, so read it back + # from the wire dict to keep the round-trip lossless. + max_instance_count=( + obj.max_instance_count if hasattr(obj, "max_instance_count") else obj.get("maxInstanceCount") + ), properties=obj.properties, docker_args=obj.docker_args_list if hasattr(obj, "docker_args_list") else obj.docker_args, shm_size=obj.shm_size, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py index 472cbc91a30d..10f72f51eb0a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/to_rest_functions.py @@ -8,8 +8,8 @@ from pathlib import Path from typing import Any +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as JobBaseData202501 from azure.ai.ml._restclient.v2023_08_01_preview.models import JobBase as JobBaseData -from azure.ai.ml._restclient.v2025_01_01_preview.models import JobBase as JobBaseData202501 from azure.ai.ml.constants._common import DEFAULT_EXPERIMENT_NAME from azure.ai.ml.entities._builders.command import Command from azure.ai.ml.entities._builders.pipeline import Pipeline diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py index d78d102ed80f..8a6f0465c22e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py @@ -7,10 +7,8 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2025_01_01_preview.models._models_py3 import CapabilityHost as RestCapabilityHost -from azure.ai.ml._restclient.v2025_01_01_preview.models._models_py3 import ( - CapabilityHostProperties as RestCapabilityHostProperties, -) +from azure.ai.ml._restclient.arm_ml_service.models import CapabilityHost as RestCapabilityHost +from azure.ai.ml._restclient.arm_ml_service.models import CapabilityHostProperties as RestCapabilityHostProperties from azure.ai.ml._schema.workspace.ai_workspaces.capability_host import CapabilityHostSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils.utils import dump_yaml_to_file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_capability_hosts_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_capability_hosts_operations.py index 499a51514b68..35552e157616 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_capability_hosts_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_capability_hosts_operations.py @@ -8,7 +8,7 @@ from marshmallow.exceptions import ValidationError as SchemaValidationError from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2025_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012025Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient012025Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, @@ -42,7 +42,7 @@ class CapabilityHostsOperations(_ScopeDependentOperations): :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client_01_2025: Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient012025Preview). - :type service_client_01_2025: ~azure.ai.ml._restclient.v2025_01_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces # pylint: disable=line-too-long + :type service_client_01_2025: ~azure.ai.ml._restclient.arm_ml_service._client.MachineLearningServicesMgmtClient # pylint: disable=line-too-long :param all_operations: All operations classes of an MLClient object. :type all_operations: ~azure.ai.ml._scope_dependent_operations.OperationsContainer :param credentials: Credential to use for authentication. @@ -68,7 +68,7 @@ def __init__( :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client_01_2025: Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient012025Preview). - :type service_client_01_2025: ~azure.ai.ml._restclient.v2025_01_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces # pylint: disable=line-too-long + :type service_client_01_2025: ~azure.ai.ml._restclient.arm_ml_service._client.MachineLearningServicesMgmtClient # pylint: disable=line-too-long :param all_operations: All operations classes of an MLClient object. :type all_operations: ~azure.ai.ml._scope_dependent_operations.OperationsContainer :param credentials: Credential to use for authentication. diff --git a/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py b/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py index efb2b46309ed..0da26e9a2fb5 100644 --- a/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/command_job/unittests/test_command_job_schema.py @@ -96,7 +96,10 @@ def test_deserialize_inputs_dataset(self): internal_representation: CommandJob = CommandJob(**schema.load(cfg)) source = internal_representation._to_rest_object() assert source.properties.inputs["test1"].uri == target["inputs"]["test1"]["path"] - assert source.properties.environment_variables == target["environment_variables"] + # environment_variables is Dict[str, str] on the REST contract; the shared client coerces + # all values to strings, so compare against the stringified expected values. + expected_env_vars = {k: str(v) for k, v in target["environment_variables"].items()} + assert source.properties.environment_variables == expected_env_vars def test_deserialize_inputs_dataset_short_form(self): test_path = "./tests/test_configs/command_job/command_job_inputs_dataset_short_form_test.yml" diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index cee238afb404..59be85932334 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -315,7 +315,7 @@ def mock_aml_services_2024_10_01_preview(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2025_01_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2025_01_01_preview") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture diff --git a/sdk/ml/azure-ai-ml/tests/workspace/ai_workspaces/unittests/test_capability_host_entity.py b/sdk/ml/azure-ai-ml/tests/workspace/ai_workspaces/unittests/test_capability_host_entity.py index 18a5f282cf07..0e8ae92d0023 100644 --- a/sdk/ml/azure-ai-ml/tests/workspace/ai_workspaces/unittests/test_capability_host_entity.py +++ b/sdk/ml/azure-ai-ml/tests/workspace/ai_workspaces/unittests/test_capability_host_entity.py @@ -4,10 +4,8 @@ import pytest from azure.ai.ml import load_capability_host -from azure.ai.ml._restclient.v2025_01_01_preview.models._models_py3 import CapabilityHost as RestCapabilityHost -from azure.ai.ml._restclient.v2025_01_01_preview.models._models_py3 import ( - CapabilityHostProperties as RestCapabilityHostProperties, -) +from azure.ai.ml._restclient.arm_ml_service.models import CapabilityHost as RestCapabilityHost +from azure.ai.ml._restclient.arm_ml_service.models import CapabilityHostProperties as RestCapabilityHostProperties from azure.ai.ml.entities._workspace._ai_workspaces.capability_host import CapabilityHost From 4b3469a909de904d4f6814b1f4c618994741842a Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 19 Jun 2026 12:00:03 +0530 Subject: [PATCH 4/6] Fix maxInstanceCount wire behavior on 2025-01 JobResourceConfiguration path Verified against the frozen 2025-01-01-preview swagger (mfe.json on the azure-ai-ml/before_tsp branch): maxInstanceCount does not exist anywhere in that contract (0 occurrences; absent from JobResourceConfiguration and its base ResourceConfiguration). The old v2025 autorest model silently ignored the max_instance_count kwarg and never serialized it, so the wire-identical behavior is to OMIT it on the arm_ml_service (202501) branch. The previous dict-style assignment added an off-contract field and is reverted. The v2023_04 (else) branch still sets max_instance_count because that version's swagger declares it. parentJobName is unaffected and remains preserved via dict assignment in command_job.py, since it IS a real 2025-01-01-preview field (declared on JobBase). --- .../_job/job_resource_configuration.py | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py index f8218c487c75..e8ed14c3758d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resource_configuration.py @@ -163,18 +163,17 @@ def properties(self, properties: Optional[Dict[str, Any]]) -> None: def _to_rest_object(self) -> Union[RestJobResourceConfiguration, RestJobResourceConfiguration202501]: if self.docker_args and isinstance(self.docker_args, list): - rest_obj = RestJobResourceConfiguration202501( + # NOTE: max_instance_count is intentionally NOT set here. The 2025-01-01-preview wire + # contract (mfe.json) has no maxInstanceCount on JobResourceConfiguration/ResourceConfiguration, + # and the old v2025 autorest model silently ignored it too, so omitting it keeps the wire + # output identical. It remains supported on the v2023_04 path below, whose swagger declares it. + return RestJobResourceConfiguration202501( instance_count=self.instance_count, instance_type=self.instance_type, properties=self.properties.as_dict() if isinstance(self.properties, Properties) else None, docker_args_list=self.docker_args, shm_size=self.shm_size, ) - # maxInstanceCount is part of the service wire contract but is not a constructor field - # on the shared arm_ml_service JobResourceConfiguration model, so set it on the wire directly. - if self.max_instance_count is not None: - rest_obj["maxInstanceCount"] = self.max_instance_count - return rest_obj return RestJobResourceConfiguration( locations=self.locations, instance_count=self.instance_count, @@ -197,12 +196,10 @@ def _from_rest_object( locations=obj.locations if hasattr(obj, "locations") else None, instance_count=obj.instance_count, instance_type=obj.instance_type, - # maxInstanceCount is a real service field. The msrest model (v2023_04) exposes it as an - # attribute; the shared arm_ml_service hybrid model does not declare it, so read it back - # from the wire dict to keep the round-trip lossless. - max_instance_count=( - obj.max_instance_count if hasattr(obj, "max_instance_count") else obj.get("maxInstanceCount") - ), + # The v2023_04 msrest model exposes max_instance_count as an attribute; the shared + # arm_ml_service model (2025-01 path) has no such field and its wire payload never + # carries maxInstanceCount, so this resolves to None there — matching the old behavior. + max_instance_count=obj.max_instance_count if hasattr(obj, "max_instance_count") else None, properties=obj.properties, docker_args=obj.docker_args_list if hasattr(obj, "docker_args_list") else obj.docker_args, shm_size=obj.shm_size, From b638ba398f400e3c6adfb314a498cfa35bfe133f Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 19 Jun 2026 13:29:16 +0530 Subject: [PATCH 5/6] Migrate v2024_10_01_preview_tsp consumers to shared arm_ml_service client Consolidate the separate v2024_10_01_preview_tsp TypeSpec client onto the shared arm_ml_service client (api_version='2024-10-01-preview') and delete the v2024_10_01_preview_tsp package. - _ml_client: wire the 2024-10 client as a partial of MachineLearningServicesMgmtClient with api_version='2024-10-01-preview' (kept the ServiceClient102024PreviewTsp alias name). - Flip all 21 production imports + 7 test files from v2024_10_01_preview_tsp to arm_ml_service. - THROWAWAY SHIM for two workspace properties that the shared client no longer declares: allowRoleAssignmentOnRG and networkAcls were @removed at api-version 2025-12-01 in the TypeSpec, and the shared client is generated at 2025-12-01, so its Workspace / WorkspaceUpdateParameters hybrid models reject them as kwargs. Both are still valid on the 2024-10-01-preview wire (verified in workspaceRP.json). Added set_removed_workspace_property / get_removed_workspace_property helpers in _utils/_workspace_utils.py that round-trip these through the hybrid model's flattened 'properties' envelope. networkAcls is nested and serialized via NetworkAcls.as_dict(). Remove this shim once the shared client is regenerated with api-version 'all'. - Update test_workspace_operations_base to assert the wire value (params.as_dict()['properties']['allowRoleAssignmentOnRG']) instead of the dropped attribute. - Delete the now-unused azure/ai/ml/_restclient/v2024_10_01_preview_tsp/ package. --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 4 +- .../v2024_10_01_preview_tsp/__init__.py | 32 - .../v2024_10_01_preview_tsp/_client.py | 554 - .../v2024_10_01_preview_tsp/_configuration.py | 81 - .../v2024_10_01_preview_tsp/_patch.py | 20 - .../_utils/__init__.py | 6 - .../_utils/model_base.py | 1755 - .../_utils/serialization.py | 2066 - .../v2024_10_01_preview_tsp/_version.py | 9 - .../v2024_10_01_preview_tsp/aio/__init__.py | 29 - .../v2024_10_01_preview_tsp/aio/_client.py | 561 - .../aio/_configuration.py | 81 - .../v2024_10_01_preview_tsp/aio/_patch.py | 20 - .../aio/operations/__init__.py | 157 - .../aio/operations/_operations.py | 45652 ------------- .../aio/operations/_patch.py | 20 - .../models/__init__.py | 1567 - .../v2024_10_01_preview_tsp/models/_enums.py | 2889 - .../v2024_10_01_preview_tsp/models/_models.py | 30353 --------- .../v2024_10_01_preview_tsp/models/_patch.py | 20 - .../operations/__init__.py | 157 - .../operations/_operations.py | 54744 ---------------- .../operations/_patch.py | 20 - .../v2024_10_01_preview_tsp/py.typed | 1 - .../v2024_10_01_preview_tsp/tsp-location.yaml | 4 - .../azure/ai/ml/_utils/_workspace_utils.py | 47 + .../azure/ai/ml/entities/_datastore/utils.py | 2 +- .../entities/_feature_store/feature_store.py | 2 +- .../finetuning/custom_model_finetuning_job.py | 2 +- .../_job/finetuning/finetuning_job.py | 2 +- .../_job/finetuning/finetuning_vertical.py | 2 +- .../ai/ml/entities/_job/job_resources.py | 2 +- .../_ai_workspaces/capability_host.py | 4 +- .../entities/_workspace/_ai_workspaces/hub.py | 4 +- .../ai/ml/entities/_workspace/diagnose.py | 10 +- .../_workspace/feature_store_settings.py | 2 +- .../ai/ml/entities/_workspace/network_acls.py | 4 +- .../ai/ml/entities/_workspace/networking.py | 14 +- .../entities/_workspace/serverless_compute.py | 2 +- .../ai/ml/entities/_workspace/workspace.py | 33 +- .../ml/entities/_workspace/workspace_keys.py | 2 +- .../ai/ml/operations/_datastore_operations.py | 8 +- .../operations/_feature_store_operations.py | 4 +- .../azure/ai/ml/operations/_job_operations.py | 2 +- .../ai/ml/operations/_workspace_operations.py | 4 +- .../operations/_workspace_operations_base.py | 22 +- .../_workspace_outbound_rule_operations.py | 4 +- sdk/ml/azure-ai-ml/tests/conftest.py | 2 +- .../tests/finetuning_job/conftest.py | 2 +- .../test_finetuning_job_convesion.py | 2 +- .../unittests/test_workspace_entity.py | 2 +- .../unittests/test_workspace_operations.py | 4 +- .../test_workspace_operations_base.py | 8 +- .../test_workspace_related_restclients.py | 30 +- 54 files changed, 153 insertions(+), 140877 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_client.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/model_base.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/serialization.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_client.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/py.typed delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/tsp-location.yaml diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 8d3253c8dd95..af8a88d8f26e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -32,9 +32,6 @@ from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042024Preview -from azure.ai.ml._restclient.v2024_10_01_preview_tsp import ( - MachineLearningServicesMgmtClient as ServiceClient102024PreviewTsp, -) from azure.ai.ml._restclient.workspace_dataplane import WorkspaceDataplaneClient as ServiceClientWorkspaceDataplane from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope from azure.ai.ml._telemetry.logging_handler import configure_appinsights_logging @@ -109,6 +106,7 @@ ServiceClient102023 = partial(MachineLearningServicesMgmtClient, api_version="2023-10-01") ServiceClient022022Preview = partial(MachineLearningServicesMgmtClient, api_version="2022-02-01-preview") ServiceClient012025Preview = partial(MachineLearningServicesMgmtClient, api_version="2025-01-01-preview") +ServiceClient102024PreviewTsp = partial(MachineLearningServicesMgmtClient, api_version="2024-10-01-preview") module_logger = logging.getLogger(__name__) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/__init__.py deleted file mode 100644 index f406cd1fbf3c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import MachineLearningServicesMgmtClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "MachineLearningServicesMgmtClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_client.py deleted file mode 100644 index 1d0c7f4d87ca..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_client.py +++ /dev/null @@ -1,554 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -import sys -from typing import Any, Optional, TYPE_CHECKING, cast - -from azure.core.pipeline import policies -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.settings import settings -from azure.mgmt.core import ARMPipelineClient -from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy -from azure.mgmt.core.tools import get_arm_endpoints - -from ._configuration import MachineLearningServicesMgmtClientConfiguration -from ._utils.serialization import Deserializer, Serializer -from .operations import ( - BatchDeploymentsOperations, - BatchEndpointsOperations, - CapabilityHostsOperations, - CodeContainersOperations, - CodeVersionsOperations, - ComponentContainersOperations, - ComponentVersionsOperations, - ComputeOperations, - ConnectionOperations, - ConnectionRaiBlocklistItemOperations, - ConnectionRaiBlocklistItemsOperations, - ConnectionRaiBlocklistOperations, - ConnectionRaiBlocklistsOperations, - ConnectionRaiPoliciesOperations, - ConnectionRaiPolicyOperations, - DataContainersOperations, - DataVersionsOperations, - DatastoresOperations, - EndpointDeploymentOperations, - EndpointOperations, - EnvironmentContainersOperations, - EnvironmentVersionsOperations, - FeaturesOperations, - FeaturesetContainersOperations, - FeaturesetVersionsOperations, - FeaturestoreEntityContainersOperations, - FeaturestoreEntityVersionsOperations, - InferenceEndpointsOperations, - InferenceGroupsOperations, - InferencePoolsOperations, - JobsOperations, - ManagedNetworkProvisionsOperations, - ManagedNetworkSettingsOperations, - ManagedNetworkSettingsRuleOperations, - MarketplaceSubscriptionsOperations, - ModelContainersOperations, - ModelVersionsOperations, - OnlineDeploymentsOperations, - OnlineEndpointsOperations, - Operations, - OutboundRuleOperations, - OutboundRulesOperations, - PTUQuotaOperations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QuotasOperations, - RaiPoliciesOperations, - RaiPolicyOperations, - RegistriesOperations, - RegistryCodeContainersOperations, - RegistryCodeVersionsOperations, - RegistryComponentContainersOperations, - RegistryComponentVersionsOperations, - RegistryDataContainersOperations, - RegistryDataReferencesOperations, - RegistryDataVersionsOperations, - RegistryEnvironmentContainersOperations, - RegistryEnvironmentVersionsOperations, - RegistryModelContainersOperations, - RegistryModelVersionsOperations, - SchedulesOperations, - ServerlessEndpointsOperations, - UsagesOperations, - VirtualMachineSizesOperations, - WorkspaceConnectionsOperations, - WorkspaceFeaturesOperations, - WorkspacesOperations, -) - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self # type: ignore - -if TYPE_CHECKING: - from azure.core import AzureClouds - from azure.core.credentials import TokenCredential - - -class MachineLearningServicesMgmtClient: # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar operations: Operations operations - :vartype operations: azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.Operations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.EndpointDeploymentOperations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.WorkspacesOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.CodeContainersOperations - :ivar registries: RegistriesOperations operations - :vartype registries: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistriesOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.DataVersionsOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.EnvironmentVersionsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.BatchDeploymentsOperations - :ivar capability_hosts: CapabilityHostsOperations operations - :vartype capability_hosts: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.CapabilityHostsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.DatastoresOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.InferenceGroupsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.MarketplaceSubscriptionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ServerlessEndpointsOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RaiPolicyOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.PrivateEndpointConnectionsOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ComputeOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.WorkspaceFeaturesOperations - :ivar connection: ConnectionOperations operations - :vartype connection: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ConnectionOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ManagedNetworkProvisionsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryCodeContainersOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryDataReferencesOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryDataVersionsOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RegistryModelVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.JobsOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.WorkspaceConnectionsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ConnectionRaiPolicyOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ConnectionRaiPoliciesOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.RaiPoliciesOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.EndpointOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ManagedNetworkSettingsRuleOperations - :ivar outbound_rule: OutboundRuleOperations operations - :vartype outbound_rule: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.OutboundRuleOperations - :ivar managed_network_settings: ManagedNetworkSettingsOperations operations - :vartype managed_network_settings: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.ManagedNetworkSettingsOperations - :ivar outbound_rules: OutboundRulesOperations operations - :vartype outbound_rules: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.OutboundRulesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.QuotasOperations - :ivar ptu_quota: PTUQuotaOperations operations - :vartype ptu_quota: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations.PTUQuotaOperations - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service host. Default value is None. - :type base_url: str - :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is - None. - :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2024-10-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - *, - cloud_setting: Optional["AzureClouds"] = None, - **kwargs: Any - ) -> None: - _endpoint = "{endpoint}" - _cloud = cloud_setting or settings.current.azure_cloud # type: ignore - _endpoints = get_arm_endpoints(_cloud) - if not base_url: - base_url = _endpoints["resource_manager"] - credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) - self._config = MachineLearningServicesMgmtClientConfiguration( - credential=credential, - subscription_id=subscription_id, - base_url=cast(str, base_url), - cloud_setting=cloud_setting, - credential_scopes=credential_scopes, - **kwargs - ) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - ARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) - - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.component_versions = ComponentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.environment_versions = EnvironmentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.model_containers = ModelContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.capability_hosts = CapabilityHostsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.inference_groups = InferenceGroupsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.online_endpoints = OnlineEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.online_deployments = OnlineDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_network_provisions = ManagedNetworkProvisionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_code_containers = RegistryCodeContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_data_references = RegistryDataReferencesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_code_versions = RegistryCodeVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_component_containers = RegistryComponentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_component_versions = RegistryComponentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_data_containers = RegistryDataContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_data_versions = RegistryDataVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_environment_containers = RegistryEnvironmentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_model_containers = RegistryModelContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_model_versions = RegistryModelVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_policy = ConnectionRaiPolicyOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_policies = ConnectionRaiPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.outbound_rule = OutboundRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings = ManagedNetworkSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.outbound_rules = OutboundRulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.ptu_quota = PTUQuotaOperations(self._client, self._config, self._serialize, self._deserialize) - - def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> Self: - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_configuration.py deleted file mode 100644 index a748f6da6cea..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_configuration.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Optional, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - from azure.core import AzureClouds - from azure.core.credentials import TokenCredential - - -class MachineLearningServicesMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for MachineLearningServicesMgmtClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". - :type base_url: str - :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is - None. - :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2024-10-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - cloud_setting: Optional["AzureClouds"] = None, - **kwargs: Any - ) -> None: - api_version: str = kwargs.pop("api_version", "2024-10-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.base_url = base_url - self.cloud_setting = cloud_setting - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "ai-ml-_restclient-v2024_10_01_preview_tsp/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_patch.py deleted file mode 100644 index ea765788358a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/__init__.py deleted file mode 100644 index 8026245c2abc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/model_base.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/model_base.py deleted file mode 100644 index bd5b9caf1022..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/model_base.py +++ /dev/null @@ -1,1755 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=protected-access, broad-except - -import copy -import calendar -import decimal -import functools -import sys -import logging -import base64 -import re -import typing -import enum -import email.utils -from datetime import datetime, date, time, timedelta, timezone -from json import JSONEncoder -import xml.etree.ElementTree as ET -from collections.abc import MutableMapping -import isodate -from azure.core.exceptions import DeserializationError -from azure.core import CaseInsensitiveEnumMeta -from azure.core.pipeline import PipelineResponse -from azure.core.serialization import _Null - -from azure.core.rest import HttpResponse - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self - -_LOGGER = logging.getLogger(__name__) - -__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] - -TZ_UTC = timezone.utc -_T = typing.TypeVar("_T") -_NONE_TYPE = type(None) - - -def _timedelta_as_isostr(td: timedelta) -> str: - """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' - - Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython - - :param timedelta td: The timedelta to convert - :rtype: str - :return: ISO8601 version of this timedelta - """ - - # Split seconds to larger units - seconds = td.total_seconds() - minutes, seconds = divmod(seconds, 60) - hours, minutes = divmod(minutes, 60) - days, hours = divmod(hours, 24) - - days, hours, minutes = list(map(int, (days, hours, minutes))) - seconds = round(seconds, 6) - - # Build date - date_str = "" - if days: - date_str = "%sD" % days - - if hours or minutes or seconds: - # Build time - time_str = "T" - - # Hours - bigger_exists = date_str or hours - if bigger_exists: - time_str += "{:02}H".format(hours) - - # Minutes - bigger_exists = bigger_exists or minutes - if bigger_exists: - time_str += "{:02}M".format(minutes) - - # Seconds - try: - if seconds.is_integer(): - seconds_string = "{:02}".format(int(seconds)) - else: - # 9 chars long w/ leading 0, 6 digits after decimal - seconds_string = "%09.6f" % seconds - # Remove trailing zeros - seconds_string = seconds_string.rstrip("0") - except AttributeError: # int.is_integer() raises - seconds_string = "{:02}".format(seconds) - - time_str += "{}S".format(seconds_string) - else: - time_str = "" - - return "P" + date_str + time_str - - -def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: - encoded = base64.b64encode(o).decode() - if format == "base64url": - return encoded.strip("=").replace("+", "-").replace("/", "_") - return encoded - - -def _serialize_datetime(o, format: typing.Optional[str] = None): - if hasattr(o, "year") and hasattr(o, "hour"): - if format == "rfc7231": - return email.utils.format_datetime(o, usegmt=True) - if format == "unix-timestamp": - return int(calendar.timegm(o.utctimetuple())) - - # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) - if not o.tzinfo: - iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() - else: - iso_formatted = o.astimezone(TZ_UTC).isoformat() - # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) - return iso_formatted.replace("+00:00", "Z") - # Next try datetime.date or datetime.time - return o.isoformat() - - -def _is_readonly(p): - try: - return p._visibility == ["read"] - except AttributeError: - return False - - -class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" - - def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): - super().__init__(*args, **kwargs) - self.exclude_readonly = exclude_readonly - self.format = format - - def default(self, o): # pylint: disable=too-many-return-statements - if _is_model(o): - if self.exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - return {k: v for k, v in o.items() if k not in readonly_props} - return dict(o.items()) - try: - return super(SdkJSONEncoder, self).default(o) - except TypeError: - if isinstance(o, _Null): - return None - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, self.format) - try: - # First try datetime.datetime - return _serialize_datetime(o, self.format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return super(SdkJSONEncoder, self).default(o) - - -_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") -_VALID_RFC7231 = re.compile( - r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" - r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" -) - -_ARRAY_ENCODE_MAPPING = { - "pipeDelimited": "|", - "spaceDelimited": " ", - "commaDelimited": ",", - "newlineDelimited": "\n", -} - - -def _deserialize_array_encoded(delimit: str, attr): - if isinstance(attr, str): - if attr == "": - return [] - return attr.split(delimit) - return attr - - -def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - attr = attr.upper() - match = _VALID_DATE.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - return date_obj # type: ignore[no-any-return] - - -def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize RFC7231 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - match = _VALID_RFC7231.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - return email.utils.parsedate_to_datetime(attr) - - -def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: - """Deserialize unix timestamp into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - return datetime.fromtimestamp(attr, TZ_UTC) - - -def _deserialize_date(attr: typing.Union[str, date]) -> date: - """Deserialize ISO-8601 formatted string into Date object. - :param str attr: response string to be deserialized. - :rtype: date - :returns: The date object from that input - """ - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - if isinstance(attr, date): - return attr - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore - - -def _deserialize_time(attr: typing.Union[str, time]) -> time: - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :returns: The time object from that input - """ - if isinstance(attr, time): - return attr - return isodate.parse_time(attr) # type: ignore[no-any-return] - - -def _deserialize_bytes(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - return bytes(base64.b64decode(attr)) - - -def _deserialize_bytes_base64(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return bytes(base64.b64decode(encoded)) - - -def _deserialize_duration(attr): - if isinstance(attr, timedelta): - return attr - return isodate.parse_duration(attr) - - -def _deserialize_decimal(attr): - if isinstance(attr, decimal.Decimal): - return attr - return decimal.Decimal(str(attr)) - - -def _deserialize_int_as_str(attr): - if isinstance(attr, int): - return attr - return int(attr) - - -_DESERIALIZE_MAPPING = { - datetime: _deserialize_datetime, - date: _deserialize_date, - time: _deserialize_time, - bytes: _deserialize_bytes, - bytearray: _deserialize_bytes, - timedelta: _deserialize_duration, - typing.Any: lambda x: x, - decimal.Decimal: _deserialize_decimal, -} - -_DESERIALIZE_MAPPING_WITHFORMAT = { - "rfc3339": _deserialize_datetime, - "rfc7231": _deserialize_datetime_rfc7231, - "unix-timestamp": _deserialize_datetime_unix_timestamp, - "base64": _deserialize_bytes, - "base64url": _deserialize_bytes_base64, -} - - -def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): - if annotation is int and rf and rf._format == "str": - return _deserialize_int_as_str - if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: - return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) - if rf and rf._format: - return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) - return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore - - -def _get_type_alias_type(module_name: str, alias_name: str): - types = { - k: v - for k, v in sys.modules[module_name].__dict__.items() - if isinstance(v, typing._GenericAlias) # type: ignore - } - if alias_name not in types: - return alias_name - return types[alias_name] - - -def _get_model(module_name: str, model_name: str): - models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} - module_end = module_name.rsplit(".", 1)[0] - models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) - if isinstance(model_name, str): - model_name = model_name.split(".")[-1] - if model_name not in models: - return model_name - return models[model_name] - - -_UNSET = object() - - -class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: dict[str, typing.Any]) -> None: - self._data = data - - def __contains__(self, key: typing.Any) -> bool: - return key in self._data - - def __getitem__(self, key: str) -> typing.Any: - # If this key has been deserialized (for mutable types), we need to handle serialization - if hasattr(self, "_attr_to_rest_field"): - cache_attr = f"_deserialized_{key}" - if hasattr(self, cache_attr): - rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) - if rf: - value = self._data.get(key) - if isinstance(value, (dict, list, set)): - # For mutable types, serialize and return - # But also update _data with serialized form and clear flag - # so mutations via this returned value affect _data - serialized = _serialize(value, rf._format) - # If serialized form is same type (no transformation needed), - # return _data directly so mutations work - if isinstance(serialized, type(value)) and serialized == value: - return self._data.get(key) - # Otherwise return serialized copy and clear flag - try: - object.__delattr__(self, cache_attr) - except AttributeError: - pass - # Store serialized form back - self._data[key] = serialized - return serialized - return self._data.__getitem__(key) - - def __setitem__(self, key: str, value: typing.Any) -> None: - # Clear any cached deserialized value when setting through dictionary access - cache_attr = f"_deserialized_{key}" - try: - object.__delattr__(self, cache_attr) - except AttributeError: - pass - self._data.__setitem__(key, value) - - def __delitem__(self, key: str) -> None: - self._data.__delitem__(key) - - def __iter__(self) -> typing.Iterator[typing.Any]: - return self._data.__iter__() - - def __len__(self) -> int: - return self._data.__len__() - - def __ne__(self, other: typing.Any) -> bool: - return not self.__eq__(other) - - def keys(self) -> typing.KeysView[str]: - """ - :returns: a set-like object providing a view on D's keys - :rtype: ~typing.KeysView - """ - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - """ - :returns: an object providing a view on D's values - :rtype: ~typing.ValuesView - """ - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - """ - :returns: set-like object providing a view on D's items - :rtype: ~typing.ItemsView - """ - return self._data.items() - - def get(self, key: str, default: typing.Any = None) -> typing.Any: - """ - Get the value for key if key is in the dictionary, else default. - :param str key: The key to look up. - :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. - :rtype: any - """ - try: - return self[key] - except KeyError: - return default - - @typing.overload - def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ - - @typing.overload - def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs - - @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs - - def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - """ - Removes specified key and return the corresponding value. - :param str key: The key to pop. - :param any default: The value to return if key is not in the dictionary - :returns: The value corresponding to the key. - :rtype: any - :raises KeyError: If key is not found and default is not given. - """ - if default is _UNSET: - return self._data.pop(key) - return self._data.pop(key, default) - - def popitem(self) -> tuple[str, typing.Any]: - """ - Removes and returns some (key, value) pair - :returns: The (key, value) pair. - :rtype: tuple - :raises KeyError: if D is empty. - """ - return self._data.popitem() - - def clear(self) -> None: - """ - Remove all items from D. - """ - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ - """ - Updates D from mapping/iterable E and F. - :param any args: Either a mapping object or an iterable of key-value pairs. - """ - self._data.update(*args, **kwargs) - - @typing.overload - def setdefault(self, key: str, default: None = None) -> None: ... - - @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs - - def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - """ - Same as calling D.get(k, d), and setting D[k]=d if k not found - :param str key: The key to look up. - :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. - :rtype: any - """ - if default is _UNSET: - return self._data.setdefault(key) - return self._data.setdefault(key, default) - - def __eq__(self, other: typing.Any) -> bool: - if isinstance(other, _MyMutableMapping): - return self._data == other._data - try: - other_model = self.__class__(other) - except Exception: - return False - return self._data == other_model._data - - def __repr__(self) -> str: - return str(self._data) - - -def _is_model(obj: typing.Any) -> bool: - return getattr(obj, "_is_model", False) - - -def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements - if isinstance(o, list): - if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): - return _ARRAY_ENCODE_MAPPING[format].join(o) - return [_serialize(x, format) for x in o] - if isinstance(o, dict): - return {k: _serialize(v, format) for k, v in o.items()} - if isinstance(o, set): - return {_serialize(x, format) for x in o} - if isinstance(o, tuple): - return tuple(_serialize(x, format) for x in o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, format) - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, enum.Enum): - return o.value - if isinstance(o, int): - if format == "str": - return str(o) - return o - try: - # First try datetime.datetime - return _serialize_datetime(o, format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return o - - -def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: - try: - return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) - except StopIteration: - return None - - -def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: - if not rf: - return _serialize(value, None) - if rf._is_multipart_file_input: - return value - if rf._is_model: - return _deserialize(rf._type, value) - if isinstance(value, ET.Element): - value = _deserialize(rf._type, value) - return _serialize(value, rf._format) - - -# ============================================================================ -# Fast-path scalar deserializer functions for rest_field(deserializer=...) -# These are referenced from rest_field declarations to bypass the generic -# _deserialize -> _deserialize_with_callable chain. -# Only simple/primitive types — no models or container types. -# ============================================================================ - - -def _xml_deser_str(value): - if isinstance(value, ET.Element): - return value.text or "" - return str(value) if value is not None else None - - -def _xml_deser_int(value): - if isinstance(value, ET.Element): - return int(value.text) if value.text else None - return int(value) if value is not None else None - - -def _xml_deser_float(value): - if isinstance(value, ET.Element): - return float(value.text) if value.text else None - return float(value) if value is not None else None - - -def _xml_deser_bool(value): - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - if text in (True, False): - return text - return text.lower() == "true" - - -# pylint: disable=docstring-missing-param -def _xml_deser_bytes(value): - """Deserialize bytes from XML (base64).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_bytes(text) - - -def _xml_deser_bytes_base64url(value): - """Deserialize bytes from XML (base64url).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_bytes_base64(text) - - -def _xml_deser_datetime(value): - """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime(text) - - -def _xml_deser_datetime_rfc7231(value): - """Deserialize a datetime from XML (RFC7231 format).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime_rfc7231(text) - - -def _xml_deser_datetime_unix_timestamp(value): - """Deserialize a datetime from XML (Unix timestamp).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime_unix_timestamp(float(text)) - - -def _xml_deser_date(value): - """Deserialize a date from XML (ISO 8601).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_date(text) - - -def _xml_deser_time(value): - """Deserialize a time from XML (ISO 8601).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_time(text) - - -def _xml_deser_duration(value): - """Deserialize a timedelta from XML (ISO 8601 duration).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_duration(text) - - -def _xml_deser_decimal(value): - """Deserialize a Decimal from XML.""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_decimal(text) - - -def _xml_deser_enum_or_str(enum_cls, value): - """Deserialize a Union[EnumType, str] from XML.""" - text = value.text if isinstance(value, ET.Element) else value - if text is None: - return None - try: - return enum_cls(text) - except ValueError: - return text - - -def _extract_xml_model_type(rf_type): - """Extract the concrete Model class from a resolved rf._type partial chain. - - Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` - wrappers. Only handles Model and Optional[Model] — other composite - types (List, Dict, Union, etc.) return None and fall through to the - generic ``_deserialize`` path at runtime. - """ - if rf_type is None: - return None - if isinstance(rf_type, type) and _is_model(rf_type): - return rf_type - if not isinstance(rf_type, functools.partial): - return None - func = rf_type.func - args = rf_type.args - if func is _deserialize_with_optional and args: - return _extract_xml_model_type(args[0]) - if func is _deserialize_model and args: - cls = args[0] - return cls if isinstance(cls, type) and _is_model(cls) else None - return None - - -def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable - cls, attr_to_rest_field: dict -) -> list: - """Build a precomputed XML field plan for fast _init_from_xml iteration. - - Called once per model class in __new__. Returns a list of tuples: - (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) - - kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text - - For Model and Optional[Model] fields that lack a scalar - ``_deserializer``, this function precomputes the Model class as the - deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` - directly instead of going through the expensive - ``_get_deserialize_callable_from_annotation`` chain at runtime. - """ - model_meta = getattr(cls, "_xml", {}) - model_ns = model_meta.get("ns") or model_meta.get("namespace") - plan = [] - - for rf in attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - deser = rf._deserializer - - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - is_optional = rf._is_optional - - # For Model / Optional[Model] fields without a scalar deserializer, - # precompute the Model class as the deserializer. - if deser is None and rf._type is not None: - model_cls = _extract_xml_model_type(rf._type) - if model_cls is not None: - deser = model_cls - - if prop_meta.get("attribute", False): - plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) - elif prop_meta.get("unwrapped", False): - items_name = prop_meta.get("itemsName") - if items_name: - items_ns = prop_meta.get("itemsNs") - if items_ns is not None: - xml_ns = items_ns - if xml_ns: - items_name = "{" + xml_ns + "}" + items_name - else: - items_name = xml_name - plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) - elif prop_meta.get("text", False): - plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) - else: - plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) - - return plan - - -# pylint: enable=docstring-missing-param -class Model(_MyMutableMapping): - _is_model = True - # label whether current class's _attr_to_rest_field has been calculated - # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: set[str] = set() - - def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: - class_name = self.__class__.__name__ - if len(args) > 1: - raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass: dict[str, typing.Any] = {} - if args: - if isinstance(args[0], ET.Element): - dict_to_pass.update(self._init_from_xml(args[0])) - else: - dict_to_pass.update( - {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} - ) - else: - non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] - if non_attr_kwargs: - # actual type errors only throw the first wrong keyword arg they see, so following that. - raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") - dict_to_pass.update( - { - self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) - for k, v in kwargs.items() - if v is not None - } - ) - # Apply client default values for fields the caller didn't set so that - # defaults are part of `_data` and therefore included during serialization. - for rf in self._attr_to_rest_field.values(): - if rf._default is _UNSET: - continue - if rf._rest_name in dict_to_pass: - continue - dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) - super().__init__(dict_to_pass) - - def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements - self, element: ET.Element - ) -> dict[str, typing.Any]: - """Deserialize an XML element into a dict mapping rest field names to values. - - :param ET.Element element: The XML element to deserialize from. - :returns: A dictionary of rest_name to deserialized value pairs. - :rtype: dict - """ - result: dict[str, typing.Any] = {} - existed_attr_keys: list[str] = [] - - field_plan = getattr(self, "_xml_field_plan", None) - if field_plan: - for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: - if kind == 0: # wrapped element (most common) - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - if deser: - result[rest_name] = deser(item) - else: - result[rest_name] = _deserialize(rf_type, item) - elif kind == 1: # attribute - attr_val = element.get(xml_name) - if attr_val is not None: - existed_attr_keys.append(xml_name) - if deser: - result[rest_name] = deser(attr_val) - else: - result[rest_name] = attr_val - elif kind == 2: # unwrapped array - items = element.findall(items_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(items_name) - if deser: - result[rest_name] = deser(items) - else: - result[rest_name] = _deserialize(rf_type, items) - elif not is_optional: - existed_attr_keys.append(items_name) - result[rest_name] = [] - elif kind == 3: # text - if element.text is not None: - if deser: - result[rest_name] = deser(element.text) - else: - result[rest_name] = element.text - else: - model_meta = getattr(self, "_xml", {}) - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in element: - if e.tag not in existed_attr_keys: - result[e.tag] = _convert_element(e) - - return result - - def copy(self) -> "Model": - return Model(self.__dict__) - - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: - if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: - # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', - # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' - mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property - k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") - } - annotations = { - k: v - for mro_class in mros - if hasattr(mro_class, "__annotations__") - for k, v in mro_class.__annotations__.items() - } - for attr, rf in attr_to_rest_field.items(): - rf._module = cls.__module__ - if not rf._type: - rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) - if not rf._rest_name_input: - rf._rest_name_input = attr - cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) - cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { - Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf - for attr, rf in cls._attr_to_rest_field.items() - } - # Build XML field plan for fast _init_from_xml (only for XML models) - if getattr(cls, "_xml", None): - cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) - cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - - return super().__new__(cls) - - def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: - for base in cls.__bases__: - if hasattr(base, "__mapping__"): - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore - - @classmethod - def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: - rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access - if rest_field_obj is None: - return attr_name - original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access - if original_tsp_name: - return original_tsp_name - return attr_name - - @classmethod - def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: - for v in cls.__dict__.values(): - if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: - return v - return None - - @classmethod - def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): - return cls(data) - discriminator = cls._get_discriminator(exist_discriminators) - if discriminator is None: - return cls(data) - exist_discriminators.append(discriminator._rest_name) - if isinstance(data, ET.Element): - model_meta = getattr(cls, "_xml", {}) - prop_meta = getattr(discriminator, "_xml", {}) - xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - if data.get(xml_name) is not None: - discriminator_value = data.get(xml_name) - else: - discriminator_value = data.find(xml_name).text # pyright: ignore - else: - discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member - return mapped_cls._deserialize(data, exist_discriminators) - - def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: - """Return a dict that can be turned into json using json.dump. - - :keyword bool exclude_readonly: Whether to remove the readonly properties. - :returns: A dict JSON compatible object - :rtype: dict - """ - - result = {} - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] - for k, v in self.items(): - if exclude_readonly and k in readonly_props: # pyright: ignore - continue - is_multipart_file_input = False - try: - is_multipart_file_input = next( - rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k - )._is_multipart_file_input - except StopIteration: - pass - result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) - return result - - @staticmethod - def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: - if v is None or isinstance(v, _Null): - return None - if isinstance(v, (list, tuple, set)): - return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) - if isinstance(v, dict): - return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} - return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v - - -def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): - if _is_model(obj): - return obj - return _deserialize(model_deserializer, obj) - - -def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): - if obj is None: - return obj - return _deserialize_with_callable(if_obj_deserializer, obj) - - -def _deserialize_with_union(deserializers, obj): - for deserializer in deserializers: - try: - return _deserialize(deserializer, obj) - except DeserializationError: - pass - raise DeserializationError() - - -def _deserialize_dict( - value_deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj: dict[typing.Any, typing.Any], -): - if obj is None: - return obj - if isinstance(obj, ET.Element): - obj = {child.tag: child for child in obj} - return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} - - -def _deserialize_multiple_sequence( - entry_deserializers: list[typing.Optional[typing.Callable]], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) - - -def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: - return ( - isinstance(deserializer, functools.partial) - and isinstance(deserializer.args[0], functools.partial) - and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable - ) - - -def _deserialize_sequence( - deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - if isinstance(obj, ET.Element): - obj = list(obj) - - # encoded string may be deserialized to sequence - if isinstance(obj, str) and isinstance(deserializer, functools.partial): - # for list[str] - if _is_array_encoded_deserializer(deserializer): - return deserializer(obj) - - # for list[Union[...]] - if isinstance(deserializer.args[0], list): - for sub_deserializer in deserializer.args[0]: - if _is_array_encoded_deserializer(sub_deserializer): - return sub_deserializer(obj) - - return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) - - -def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: - return sorted( - types, - key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), - ) - - -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches - annotation: typing.Any, - module: typing.Optional[str], - rf: typing.Optional["_RestField"] = None, -) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - if not annotation: - return None - - # is it a type alias? - if isinstance(annotation, str): - if module is not None: - annotation = _get_type_alias_type(module, annotation) - - # is it a forward ref / in quotes? - if isinstance(annotation, (str, typing.ForwardRef)): - try: - model_name = annotation.__forward_arg__ # type: ignore - except AttributeError: - model_name = annotation - if module is not None: - annotation = _get_model(module, model_name) # type: ignore - - try: - if module and _is_model(annotation): - if rf: - rf._is_model = True - - return functools.partial(_deserialize_model, annotation) # pyright: ignore - except Exception: - pass - - # is it a literal? - try: - if annotation.__origin__ is typing.Literal: # pyright: ignore - return None - except AttributeError: - pass - - # is it optional? - try: - if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore - if rf: - rf._is_optional = True - if len(annotation.__args__) <= 2: # pyright: ignore - if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_with_optional, if_obj_deserializer) - # the type is Optional[Union[...]], we need to remove the None type from the Union - annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore - return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) - except AttributeError: - pass - - # is it union? - if getattr(annotation, "__origin__", None) is typing.Union: - # initial ordering is we make `string` the last deserialization option, because it is often them most generic - deserializers = [ - _get_deserialize_callable_from_annotation(arg, module, rf) - for arg in _sorted_annotations(annotation.__args__) # pyright: ignore - ] - - return functools.partial(_deserialize_with_union, deserializers) - - try: - annotation_name = ( - annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore - ) - if annotation_name.lower() == "dict": - value_deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[1], module, rf # pyright: ignore - ) - - return functools.partial( - _deserialize_dict, - value_deserializer, - module, - ) - except (AttributeError, IndexError): - pass - try: - annotation_name = ( - annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore - ) - if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: - if len(annotation.__args__) > 1: # pyright: ignore - entry_deserializers = [ - _get_deserialize_callable_from_annotation(dt, module, rf) - for dt in annotation.__args__ # pyright: ignore - ] - return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) - deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[0], module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_sequence, deserializer, module) - except (TypeError, IndexError, AttributeError, SyntaxError): - pass - - def _deserialize_default( - deserializer, - obj, - ): - if obj is None: - return obj - try: - return _deserialize_with_callable(deserializer, obj) - except Exception: - pass - return obj - - if get_deserializer(annotation, rf): - return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) - - return functools.partial(_deserialize_default, annotation) - - -def _deserialize_with_callable( - deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], - value: typing.Any, -): # pylint: disable=too-many-return-statements - try: - if value is None or isinstance(value, _Null): - return None - if isinstance(value, ET.Element): - if deserializer is str: - return value.text or "" - if deserializer is int: - return int(value.text) if value.text else None - if deserializer is float: - return float(value.text) if value.text else None - if deserializer is bool: - return value.text == "true" if value.text else None - if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): - return deserializer(value.text) if value.text else None - if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): - return deserializer(value.text) if value.text else None - if deserializer is None: - return value - if deserializer in [int, float, bool]: - return deserializer(value) - if isinstance(deserializer, CaseInsensitiveEnumMeta): - try: - return deserializer(value.text if isinstance(value, ET.Element) else value) - except ValueError: - # for unknown value, return raw value - return value.text if isinstance(value, ET.Element) else value - if isinstance(deserializer, type) and issubclass(deserializer, Model): - return deserializer._deserialize(value, []) - return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) - except Exception as e: - raise DeserializationError() from e - - -def _deserialize( - deserializer: typing.Any, - value: typing.Any, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - if isinstance(value, PipelineResponse): - value = value.http_response.json() - if rf is None and format: - rf = _RestField(format=format) - if not isinstance(deserializer, functools.partial): - deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) - return _deserialize_with_callable(deserializer, value) - - -def _failsafe_deserialize( - deserializer: typing.Any, - response: HttpResponse, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - try: - return _deserialize(deserializer, response.json(), module, rf, format) - except Exception: # pylint: disable=broad-except - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -def _failsafe_deserialize_xml( - deserializer: typing.Any, - response: HttpResponse, -) -> typing.Any: - try: - return _deserialize_xml(deserializer, response.text()) - except Exception: # pylint: disable=broad-except - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -# pylint: disable=too-many-instance-attributes -class _RestField: - def __init__( - self, - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - is_discriminator: bool = False, - visibility: typing.Optional[list[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, - xml: typing.Optional[dict[str, typing.Any]] = None, - deserializer: typing.Optional[typing.Callable] = None, - original_tsp_name: typing.Optional[str] = None, - ): - self._type = type - self._rest_name_input = name - self._module: typing.Optional[str] = None - self._is_discriminator = is_discriminator - self._visibility = visibility - self._is_model = False - self._is_optional = False - self._default = default - self._format = format - self._is_multipart_file_input = is_multipart_file_input - self._xml = xml if xml is not None else {} - self._deserializer = deserializer - self._original_tsp_name = original_tsp_name - - @property - def _class_type(self) -> typing.Any: - result = getattr(self._type, "args", [None])[0] - # type may be wrapped by nested functools.partial so we need to check for that - if isinstance(result, functools.partial): - return getattr(result, "args", [None])[0] - return result - - @property - def _rest_name(self) -> str: - if self._rest_name_input is None: - raise ValueError("Rest name was never set") - return self._rest_name_input - - def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin - # by this point, type and rest_name will have a value bc we default - # them in __new__ of the Model class - # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name, _UNSET) - if item is _UNSET: - # Field not set by user; return the client default if one exists, otherwise None - return self._default if self._default is not _UNSET else None - if item is None: - return item - if self._is_model: - return item - - # For mutable types, we want mutations to directly affect _data - # Check if we've already deserialized this value - cache_attr = f"_deserialized_{self._rest_name}" - if hasattr(obj, cache_attr): - # Return the value from _data directly (it's been deserialized in place) - return obj._data.get(self._rest_name) - - # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) - if self._deserializer: - deserialized = self._deserializer(item) - else: - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) - - # For mutable types, store the deserialized value back in _data - # so mutations directly affect _data - if isinstance(deserialized, (dict, list, set)): - obj._data[self._rest_name] = deserialized - object.__setattr__(obj, cache_attr, True) # Mark as deserialized - return deserialized - - return deserialized - - def __set__(self, obj: Model, value) -> None: - # Clear the cached deserialized object when setting a new value - cache_attr = f"_deserialized_{self._rest_name}" - if hasattr(obj, cache_attr): - object.__delattr__(obj, cache_attr) - - if value is None: - # we want to wipe out entries if users set attr to None - try: - obj.__delitem__(self._rest_name) - except KeyError: - pass - return - if self._is_model: - if not _is_model(value): - value = _deserialize(self._type, value) - obj.__setitem__(self._rest_name, value) - return - obj.__setitem__(self._rest_name, _serialize(value, self._format)) - - def _get_deserialize_callable_from_annotation( - self, annotation: typing.Any - ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - return _get_deserialize_callable_from_annotation(annotation, self._module, self) - - -def rest_field( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[list[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, - xml: typing.Optional[dict[str, typing.Any]] = None, - deserializer: typing.Optional[typing.Callable] = None, - original_tsp_name: typing.Optional[str] = None, -) -> typing.Any: - return _RestField( - name=name, - type=type, - visibility=visibility, - default=default, - format=format, - is_multipart_file_input=is_multipart_file_input, - xml=xml, - deserializer=deserializer, - original_tsp_name=original_tsp_name, - ) - - -def rest_discriminator( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[list[str]] = None, - xml: typing.Optional[dict[str, typing.Any]] = None, -) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) - - -def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: - """Serialize a model to XML. - - :param Model model: The model to serialize. - :param bool exclude_readonly: Whether to exclude readonly properties. - :returns: The XML representation of the model. - :rtype: str - """ - return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore - - -def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: - """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. - - :param dict meta: The metadata dictionary to extract namespace from. - :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. - :rtype: str or None - """ - ns = meta.get("ns") - if ns is None: - ns = meta.get("namespace") - return ns - - -def _resolve_xml_ns( - prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None -) -> typing.Optional[str]: - """Resolve XML namespace for a property, falling back to model namespace when appropriate. - - Checks the property metadata first; if no namespace is found and the model does not declare - an explicit prefix, falls back to the model-level namespace. - - :param dict prop_meta: The property metadata dictionary. - :param dict model_meta: The model metadata dictionary, used as fallback. - :returns: The resolved namespace string, or None. - :rtype: str or None - """ - ns = _get_xml_ns(prop_meta) - if ns is None and model_meta is not None and not model_meta.get("prefix"): - ns = _get_xml_ns(model_meta) - return ns - - -def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: - """Set an XML attribute on an element, handling namespace prefix registration. - - :param ET.Element element: The element to set the attribute on. - :param str name: The default attribute name (wire name). - :param any value: The attribute value. - :param dict prop_meta: The property metadata dictionary. - """ - xml_name = prop_meta.get("name", name) - _attr_ns = _get_xml_ns(prop_meta) - if _attr_ns: - _attr_prefix = prop_meta.get("prefix") - if _attr_prefix: - _safe_register_namespace(_attr_prefix, _attr_ns) - xml_name = "{" + _attr_ns + "}" + xml_name - element.set(xml_name, _get_primitive_type_value(value)) - - -def _get_element( - o: typing.Any, - exclude_readonly: bool = False, - parent_meta: typing.Optional[dict[str, typing.Any]] = None, - wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, list[ET.Element]]: - if _is_model(o): - model_meta = getattr(o, "_xml", {}) - - # if prop is a model, then use the prop element directly, else generate a wrapper of model - if wrapped_element is None: - # When serializing as an array item (parent_meta is set), check if the parent has an - # explicit itemsName. This ensures correct element names for unwrapped arrays (where - # the element tag is the property/items name, not the model type name). - _items_name = parent_meta.get("itemsName") if parent_meta is not None else None - element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) - _model_ns = _get_xml_ns(model_meta) - wrapped_element = _create_xml_element( - element_name, - model_meta.get("prefix"), - _model_ns, - ) - - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - - for k, v in o.items(): - # do not serialize readonly properties - if exclude_readonly and k in readonly_props: - continue - - prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) - if prop_rest_field: - prop_meta = getattr(prop_rest_field, "_xml").copy() - # use the wire name as xml name if no specific name is set - if prop_meta.get("name") is None: - prop_meta["name"] = k - else: - # additional properties will not have rest field, use the wire name as xml name - prop_meta = {"name": k} - - # Propagate model namespace to properties only for old-style "ns"-keyed models. - # DPG-generated models use the "namespace" key and explicitly declare namespace on - # each property that needs it, so propagation is intentionally skipped for them. - if prop_meta.get("ns") is None and model_meta.get("ns"): - prop_meta["ns"] = model_meta.get("ns") - prop_meta["prefix"] = model_meta.get("prefix") - - if prop_meta.get("unwrapped", False): - # unwrapped could only set on array - wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) - elif prop_meta.get("text", False): - # text could only set on primitive type - wrapped_element.text = _get_primitive_type_value(v) - elif prop_meta.get("attribute", False): - _set_xml_attribute(wrapped_element, k, v, prop_meta) - else: - # other wrapped prop element - wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) - return wrapped_element - if isinstance(o, list): - return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore - if isinstance(o, dict): - result = [] - _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None - for k, v in o.items(): - result.append( - _get_wrapped_element( - v, - exclude_readonly, - { - "name": k, - "ns": _dict_ns, - "prefix": parent_meta.get("prefix") if parent_meta else None, - }, - ) - ) - return result - - # primitive case need to create element based on parent_meta - if parent_meta: - _items_ns = parent_meta.get("itemsNs") - if _items_ns is None: - _items_ns = _get_xml_ns(parent_meta) - return _get_wrapped_element( - o, - exclude_readonly, - { - "name": parent_meta.get("itemsName", parent_meta.get("name")), - "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": _items_ns, - }, - ) - - raise ValueError("Could not serialize value into xml: " + o) - - -def _get_wrapped_element( - v: typing.Any, - exclude_readonly: bool, - meta: typing.Optional[dict[str, typing.Any]], -) -> ET.Element: - _meta_ns = _get_xml_ns(meta) if meta else None - wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns - ) - if isinstance(v, (dict, list)): - wrapped_element.extend(_get_element(v, exclude_readonly, meta)) - elif _is_model(v): - _get_element(v, exclude_readonly, meta, wrapped_element) - else: - wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element # type: ignore[no-any-return] - - -def _get_primitive_type_value(v) -> str: - if v is True: - return "true" - if v is False: - return "false" - if isinstance(v, _Null): - return "" - return str(v) - - -def _safe_register_namespace(prefix: str, ns: str) -> None: - """Register an XML namespace prefix, handling reserved prefix patterns. - - Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for - auto-generated prefixes, causing register_namespace to raise ValueError. - Falls back to directly registering in the internal namespace map. - - :param str prefix: The namespace prefix to register. - :param str ns: The namespace URI. - """ - try: - ET.register_namespace(prefix, ns) - except ValueError: - _ns_map = getattr(ET, "_namespace_map", None) - if _ns_map is not None: - _ns_map[ns] = prefix - - -def _create_xml_element( - tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None -) -> ET.Element: - if prefix and ns: - _safe_register_namespace(prefix, ns) - if ns: - return ET.Element("{" + ns + "}" + tag) - return ET.Element(tag) - - -def _deserialize_xml( - deserializer: typing.Any, - value: str, -) -> typing.Any: - element = ET.fromstring(value) # nosec - if _is_model(deserializer): - return deserializer._deserialize(element, []) - return _deserialize(deserializer, element) - - -def _convert_element(e: ET.Element): - # dict case - if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: dict[str, typing.Any] = {} - for child in e: - if dict_result.get(child.tag) is not None: - if isinstance(dict_result[child.tag], list): - dict_result[child.tag].append(_convert_element(child)) - else: - dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] - else: - dict_result[child.tag] = _convert_element(child) - dict_result.update(e.attrib) - return dict_result - # array case - if len(e) > 0: - array_result: list[typing.Any] = [] - for child in e: - array_result.append(_convert_element(child)) - return array_result - # primitive case - return e.text diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/serialization.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/serialization.py deleted file mode 100644 index a088671e9c51..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_utils/serialization.py +++ /dev/null @@ -1,2066 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -# pyright: reportUnnecessaryTypeIgnoreComment=false - -from base64 import b64decode, b64encode -import calendar -import datetime -import decimal -import email -from enum import Enum -import json -import logging -import re -import sys -import codecs -from typing import ( - Any, - cast, - Optional, - Union, - AnyStr, - IO, - Mapping, - Callable, - MutableMapping, -) - -try: - from urllib import quote # type: ignore -except ImportError: - from urllib.parse import quote -import xml.etree.ElementTree as ET - -import isodate # type: ignore - -from azure.core.exceptions import DeserializationError, SerializationError -from azure.core.serialization import NULL as CoreNull - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self - -_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") - -JSON = MutableMapping[str, Any] - - -class RawDeserializer: - - # Accept "text" because we're open minded people... - JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") - - # Name used in context - CONTEXT_NAME = "deserialized_data" - - @classmethod - def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: - """Decode data according to content-type. - - Accept a stream of data as well, but will be load at once in memory for now. - - If no content-type, will return the string version (not bytes, not stream) - - :param data: Input, could be bytes or stream (will be decoded with UTF8) or text - :type data: str or bytes or IO - :param str content_type: The content type. - :return: The deserialized data. - :rtype: object - """ - if hasattr(data, "read"): - # Assume a stream - data = cast(IO, data).read() - - if isinstance(data, bytes): - data_as_str = data.decode(encoding="utf-8-sig") - else: - # Explain to mypy the correct type. - data_as_str = cast(str, data) - - # Remove Byte Order Mark if present in string - data_as_str = data_as_str.lstrip(_BOM) - - if content_type is None: - return data - - if cls.JSON_REGEXP.match(content_type): - try: - return json.loads(data_as_str) - except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) from err - elif "xml" in (content_type or []): - try: - - try: - if isinstance(data, unicode): # type: ignore - # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string - data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore - except NameError: - pass - - return ET.fromstring(data_as_str) # nosec - except ET.ParseError as err: - # It might be because the server has an issue, and returned JSON with - # content-type XML.... - # So let's try a JSON load, and if it's still broken - # let's flow the initial exception - def _json_attemp(data): - try: - return True, json.loads(data) - except ValueError: - return False, None # Don't care about this one - - success, json_result = _json_attemp(data) - if success: - return json_result - # If i'm here, it's not JSON, it's not XML, let's scream - # and raise the last context in this block (the XML exception) - # The function hack is because Py2.7 messes up with exception - # context otherwise. - _LOGGER.critical("Wasn't XML not JSON, failing") - raise DeserializationError("XML is invalid") from err - elif content_type.startswith("text/"): - return data_as_str - raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) - - @classmethod - def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: - """Deserialize from HTTP response. - - Use bytes and headers to NOT use any requests/aiohttp or whatever - specific implementation. - Headers will tested for "content-type" - - :param bytes body_bytes: The body of the response. - :param dict headers: The headers of the response. - :returns: The deserialized data. - :rtype: object - """ - # Try to use content-type from headers if available - content_type = None - if "content-type" in headers: - content_type = headers["content-type"].split(";")[0].strip().lower() - # Ouch, this server did not declare what it sent... - # Let's guess it's JSON... - # Also, since Autorest was considering that an empty body was a valid JSON, - # need that test as well.... - else: - content_type = "application/json" - - if body_bytes: - return cls.deserialize_from_text(body_bytes, content_type) - return None - - -_LOGGER = logging.getLogger(__name__) - -try: - _long_type = long # type: ignore -except NameError: - _long_type = int - -TZ_UTC = datetime.timezone.utc - -_FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[dict[str, Any]] = {} - for k in kwargs: # pylint: disable=consider-using-dict-items - if k not in self._attribute_map: - _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) - elif k in self._validation and self._validation[k].get("readonly", False): - _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) - else: - setattr(self, k, kwargs[k]) - - def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes. - - :param object other: The object to compare - :returns: True if objects are equal - :rtype: bool - """ - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes. - - :param object other: The object to compare - :returns: True if objects are not equal - :rtype: bool - """ - return not self.__eq__(other) - - def __str__(self) -> str: - return str(self.__dict__) - - @classmethod - def enable_additional_properties_sending(cls) -> None: - cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} - - @classmethod - def is_xml_model(cls) -> bool: - try: - cls._xml_map # type: ignore - except AttributeError: - return False - return True - - @classmethod - def _create_xml_node(cls): - """Create XML node. - - :returns: The XML node - :rtype: xml.etree.ElementTree.Element - """ - try: - xml_map = cls._xml_map # type: ignore - except AttributeError: - xml_map = {} - - return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - - def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to server from this model. - - This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param bool keep_readonly: If you want to serialize the readonly attributes - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize( # type: ignore # pylint: disable=protected-access - self, keep_readonly=keep_readonly, **kwargs - ) - - def as_dict( - self, - keep_readonly: bool = True, - key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, - **kwargs: Any - ) -> JSON: - """Return a dict that can be serialized using json.dump. - - Advanced usage might optionally use a callback as parameter: - - .. code::python - - def my_key_transformer(key, attr_desc, value): - return key - - Key is the attribute name used in Python. Attr_desc - is a dict of metadata. Currently contains 'type' with the - msrest type and 'key' with the RestAPI encoded key. - Value is the current value in this object. - - The string returned will be used to serialize the key. - If the return type is a list, this is considered hierarchical - result dict. - - See the three examples in this file: - - - attribute_transformer - - full_restapi_key_transformer - - last_restapi_key_transformer - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param bool keep_readonly: If you want to serialize the readonly attributes - :param function key_transformer: A key transformer function. - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize( # type: ignore # pylint: disable=protected-access - self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs - ) - - @classmethod - def _infer_class_models(cls): - try: - str_models = cls.__module__.rsplit(".", 1)[0] - models = sys.modules[str_models] - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - if cls.__name__ not in client_models: - raise ValueError("Not Autorest generated code") - except Exception: # pylint: disable=broad-exception-caught - # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. - client_models = {cls.__name__: cls} - return client_models - - @classmethod - def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: - """Parse a str using the RestAPI syntax and return a model. - - :param str data: A str using RestAPI structure. JSON by default. - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises DeserializationError: if something went wrong - :rtype: Self - """ - deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def from_dict( - cls, - data: Any, - key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, - content_type: Optional[str] = None, - ) -> Self: - """Parse a dict using given key extractor return a model. - - By default consider key - extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor - and last_rest_key_case_insensitive_extractor) - - :param dict data: A dict using RestAPI structure - :param function key_extractors: A key extractor function. - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises DeserializationError: if something went wrong - :rtype: Self - """ - deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( # type: ignore - [ # type: ignore - attribute_key_case_insensitive_extractor, - rest_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - if key_extractors is None - else key_extractors - ) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def _flatten_subtype(cls, key, objects): - if "_subtype_map" not in cls.__dict__: - return {} - result = dict(cls._subtype_map[key]) - for valuetype in cls._subtype_map[key].values(): - result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access - return result - - @classmethod - def _classify(cls, response, objects): - """Check the class _subtype_map for any child classes. - We want to ignore any inherited _subtype_maps. - - :param dict response: The initial data - :param dict objects: The class objects - :returns: The class to be used - :rtype: class - """ - for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): - subtype_value = None - - if not isinstance(response, ET.Element): - rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) - else: - subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) - if subtype_value: - # Try to match base class. Can be class name only - # (bug to fix in Autorest to support x-ms-discriminator-name) - if cls.__name__ == subtype_value: - return cls - flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) - try: - return objects[flatten_mapping_type[subtype_value]] # type: ignore - except KeyError: - _LOGGER.warning( - "Subtype value %s has no mapping, use base class %s.", - subtype_value, - cls.__name__, - ) - break - else: - _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) - break - return cls - - @classmethod - def _get_rest_key_parts(cls, attr_key): - """Get the RestAPI key of this attr, split it and decode part - :param str attr_key: Attribute key must be in attribute_map. - :returns: A list of RestAPI part - :rtype: list - """ - rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) - return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] - - -def _decode_attribute_map_key(key): - """This decode a key in an _attribute_map to the actual key we want to look at - inside the received data. - - :param str key: A key string from the generated code - :returns: The decoded key - :rtype: str - """ - return key.replace("\\.", ".") - - -class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} - days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} - months = { - 1: "Jan", - 2: "Feb", - 3: "Mar", - 4: "Apr", - 5: "May", - 6: "Jun", - 7: "Jul", - 8: "Aug", - 9: "Sep", - 10: "Oct", - 11: "Nov", - 12: "Dec", - } - validation = { - "min_length": lambda x, y: len(x) < y, - "max_length": lambda x, y: len(x) > y, - "minimum": lambda x, y: x < y, - "maximum": lambda x, y: x > y, - "minimum_ex": lambda x, y: x <= y, - "maximum_ex": lambda x, y: x >= y, - "min_items": lambda x, y: len(x) < y, - "max_items": lambda x, y: len(x) > y, - "pattern": lambda x, y: not re.match(y, x, re.UNICODE), - "unique": lambda x, y: len(x) != len(set(x)), - "multiple": lambda x, y: x % y != 0, - } - - def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: - self.serialize_type = { - "iso-8601": Serializer.serialize_iso, - "rfc-1123": Serializer.serialize_rfc, - "unix-time": Serializer.serialize_unix, - "duration": Serializer.serialize_duration, - "date": Serializer.serialize_date, - "time": Serializer.serialize_time, - "decimal": Serializer.serialize_decimal, - "long": Serializer.serialize_long, - "bytearray": Serializer.serialize_bytearray, - "base64": Serializer.serialize_base64, - "object": self.serialize_object, - "[]": self.serialize_iter, - "{}": self.serialize_dict, - } - self.dependencies: dict[str, type] = dict(classes) if classes else {} - self.key_transformer = full_restapi_key_transformer - self.client_side_validation = True - - def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals - self, target_obj, data_type=None, **kwargs - ): - """Serialize data into a string according to type. - - :param object target_obj: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str, dict - :raises SerializationError: if serialization fails. - :returns: The serialized data. - """ - key_transformer = kwargs.get("key_transformer", self.key_transformer) - keep_readonly = kwargs.get("keep_readonly", False) - if target_obj is None: - return None - - attr_name = None - class_name = target_obj.__class__.__name__ - - if data_type: - return self.serialize_data(target_obj, data_type, **kwargs) - - if not hasattr(target_obj, "_attribute_map"): - data_type = type(target_obj).__name__ - if data_type in self.basic_types.values(): - return self.serialize_data(target_obj, data_type, **kwargs) - - # Force "is_xml" kwargs if we detect a XML model - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) - - serialized = {} - if is_xml_model_serialization: - serialized = target_obj._create_xml_node() # pylint: disable=protected-access - try: - attributes = target_obj._attribute_map # pylint: disable=protected-access - for attr, attr_desc in attributes.items(): - attr_name = attr - if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access - attr_name, {} - ).get("readonly", False): - continue - - if attr_name == "additional_properties" and attr_desc["key"] == "": - if target_obj.additional_properties is not None: - serialized |= target_obj.additional_properties - continue - try: - - orig_attr = getattr(target_obj, attr) - if is_xml_model_serialization: - pass # Don't provide "transformer" for XML for now. Keep "orig_attr" - else: # JSON - keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) - keys = keys if isinstance(keys, list) else [keys] - - kwargs["serialization_ctxt"] = attr_desc - new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) - - if is_xml_model_serialization: - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - xml_prefix = xml_desc.get("prefix", None) - xml_ns = xml_desc.get("ns", None) - if xml_desc.get("attr", False): - if xml_ns: - ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) # type: ignore - continue - if xml_desc.get("text", False): - serialized.text = new_attr # type: ignore - continue - if isinstance(new_attr, list): - serialized.extend(new_attr) # type: ignore - elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, - # we MUST replace the tag with the local tag. But keeping the namespaces. - if "name" not in getattr(orig_attr, "_xml_map", {}): - splitted_tag = new_attr.tag.split("}") - if len(splitted_tag) == 2: # Namespace - new_attr.tag = "}".join([splitted_tag[0], xml_name]) - else: - new_attr.tag = xml_name - serialized.append(new_attr) # type: ignore - else: # That's a basic type - # Integrate namespace if necessary - local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = str(new_attr) - serialized.append(local_node) # type: ignore - else: # JSON - for k in reversed(keys): # type: ignore - new_attr = {k: new_attr} - - _new_attr = new_attr - _serialized = serialized - for k in keys: # type: ignore - if k not in _serialized: - _serialized.update(_new_attr) # type: ignore - _new_attr = _new_attr[k] # type: ignore - _serialized = _serialized[k] - except ValueError as err: - if isinstance(err, SerializationError): - raise - - except (AttributeError, KeyError, TypeError) as err: - msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise SerializationError(msg) from err - return serialized - - def body(self, data, data_type, **kwargs): - """Serialize data intended for a request body. - - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: dict - :raises SerializationError: if serialization fails. - :raises ValueError: if data is None - :returns: The serialized request body - """ - - # Just in case this is a dict - internal_data_type_str = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type_str, None) - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - if internal_data_type and issubclass(internal_data_type, Model): - is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) - else: - is_xml_model_serialization = False - if internal_data_type and not isinstance(internal_data_type, Enum): - try: - deserializer = Deserializer(self.dependencies) - # Since it's on serialization, it's almost sure that format is not JSON REST - # We're not able to deal with additional properties for now. - deserializer.additional_properties_detection = False - if is_xml_model_serialization: - deserializer.key_extractors = [ # type: ignore - attribute_key_case_insensitive_extractor, - ] - else: - deserializer.key_extractors = [ - rest_key_case_insensitive_extractor, - attribute_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access - except DeserializationError as err: - raise SerializationError("Unable to build a model: " + str(err)) from err - - return self._serialize(data, data_type, **kwargs) - - def url(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL path. - - :param str name: The name of the URL path parameter. - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :returns: The serialized URL path - :raises TypeError: if serialization fails. - :raises ValueError: if data is None - """ - try: - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - - if kwargs.get("skip_quote") is True: - output = str(output) - output = output.replace("{", quote("{")).replace("}", quote("}")) - else: - output = quote(str(output), safe="") - except SerializationError as exc: - raise TypeError("{} must be type {}.".format(name, data_type)) from exc - return output - - def query(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL query. - - :param str name: The name of the query parameter. - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str, list - :raises TypeError: if serialization fails. - :raises ValueError: if data is None - :returns: The serialized query parameter - """ - try: - # Treat the list aside, since we don't want to encode the div separator - if data_type.startswith("["): - internal_data_type = data_type[1:-1] - do_quote = not kwargs.get("skip_quote", False) - return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) - - # Not a list, regular serialization - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - if kwargs.get("skip_quote") is True: - output = str(output) - else: - output = quote(str(output), safe="") - except SerializationError as exc: - raise TypeError("{} must be type {}.".format(name, data_type)) from exc - return str(output) - - def header(self, name, data, data_type, **kwargs): - """Serialize data intended for a request header. - - :param str name: The name of the header. - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises TypeError: if serialization fails. - :raises ValueError: if data is None - :returns: The serialized header - """ - try: - if data_type in ["[str]"]: - data = ["" if d is None else d for d in data] - - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - except SerializationError as exc: - raise TypeError("{} must be type {}.".format(name, data_type)) from exc - return str(output) - - def serialize_data(self, data, data_type, **kwargs): - """Serialize generic data according to supplied data type. - - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :raises AttributeError: if required data is None. - :raises ValueError: if data is None - :raises SerializationError: if serialization fails. - :returns: The serialized data. - :rtype: str, int, float, bool, dict, list - """ - if data is None: - raise ValueError("No value for given attribute") - - try: - if data is CoreNull: - return None - if data_type in self.basic_types.values(): - return self.serialize_basic(data, data_type, **kwargs) - - if data_type in self.serialize_type: - return self.serialize_type[data_type](data, **kwargs) - - # If dependencies is empty, try with current data class - # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) - if issubclass(enum_type, Enum): - return Serializer.serialize_enum(data, enum_obj=enum_type) - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.serialize_type: - return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) - - except (ValueError, TypeError) as err: - msg = "Unable to serialize value: {!r} as type: {!r}." - raise SerializationError(msg.format(data, data_type)) from err - return self._serialize(data, **kwargs) - - @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements - custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) - if custom_serializer: - return custom_serializer - if kwargs.get("is_xml", False): - return cls._xml_basic_types_serializers.get(data_type) - - @classmethod - def serialize_basic(cls, data, data_type, **kwargs): - """Serialize basic builting data type. - Serializes objects to str, int, float or bool. - - Possible kwargs: - - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - - is_xml bool : If set, use xml_basic_types_serializers - - :param obj data: Object to be serialized. - :param str data_type: Type of object in the iterable. - :rtype: str, int, float, bool - :return: serialized object - :raises TypeError: raise if data_type is not one of str, int, float, bool. - """ - custom_serializer = cls._get_custom_serializers(data_type, **kwargs) - if custom_serializer: - return custom_serializer(data) - if data_type == "str": - return cls.serialize_unicode(data) - if data_type == "int": - return int(data) - if data_type == "float": - return float(data) - if data_type == "bool": - return bool(data) - raise TypeError("Unknown basic data type: {}".format(data_type)) - - @classmethod - def serialize_unicode(cls, data): - """Special handling for serializing unicode strings in Py2. - Encode to UTF-8 if unicode, otherwise handle as a str. - - :param str data: Object to be serialized. - :rtype: str - :return: serialized object - """ - try: # If I received an enum, return its value - return data.value - except AttributeError: - pass - - try: - if isinstance(data, unicode): # type: ignore - # Don't change it, JSON and XML ElementTree are totally able - # to serialize correctly u'' strings - return data - except NameError: - return str(data) - return str(data) - - def serialize_iter(self, data, iter_type, div=None, **kwargs): - """Serialize iterable. - - Supported kwargs: - - serialization_ctxt dict : The current entry of _attribute_map, or same format. - serialization_ctxt['type'] should be same as data_type. - - is_xml bool : If set, serialize as XML - - :param list data: Object to be serialized. - :param str iter_type: Type of object in the iterable. - :param str div: If set, this str will be used to combine the elements - in the iterable into a combined string. Default is 'None'. - Defaults to False. - :rtype: list, str - :return: serialized iterable - """ - if isinstance(data, str): - raise SerializationError("Refuse str type as a valid iter type.") - - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - is_xml = kwargs.get("is_xml", False) - - serialized = [] - for d in data: - try: - serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized.append(None) - - if kwargs.get("do_quote", False): - serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] - - if div: - serialized = ["" if s is None else str(s) for s in serialized] - serialized = div.join(serialized) - - if "xml" in serialization_ctxt or is_xml: - # XML serialization is more complicated - xml_desc = serialization_ctxt.get("xml", {}) - xml_name = xml_desc.get("name") - if not xml_name: - xml_name = serialization_ctxt["key"] - - # Create a wrap node if necessary (use the fact that Element and list have "append") - is_wrapped = xml_desc.get("wrapped", False) - node_name = xml_desc.get("itemsName", xml_name) - if is_wrapped: - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - else: - final_result = [] - # All list elements to "local_node" - for el in serialized: - if isinstance(el, ET.Element): - el_node = el - else: - el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - if el is not None: # Otherwise it writes "None" :-p - el_node.text = str(el) - final_result.append(el_node) - return final_result - return serialized - - def serialize_dict(self, attr, dict_type, **kwargs): - """Serialize a dictionary of objects. - - :param dict attr: Object to be serialized. - :param str dict_type: Type of object in the dictionary. - :rtype: dict - :return: serialized dictionary - """ - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized[self.serialize_unicode(key)] = None - - if "xml" in serialization_ctxt: - # XML serialization is more complicated - xml_desc = serialization_ctxt["xml"] - xml_name = xml_desc["name"] - - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - for key, value in serialized.items(): - ET.SubElement(final_result, key).text = value - return final_result - - return serialized - - def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements - """Serialize a generic object. - This will be handled as a dictionary. If object passed in is not - a basic type (str, int, float, dict, list) it will simply be - cast to str. - - :param dict attr: Object to be serialized. - :rtype: dict or str - :return: serialized object - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - return attr - obj_type = type(attr) - if obj_type in self.basic_types: - return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) - if obj_type is _long_type: - return self.serialize_long(attr) - if obj_type is str: - return self.serialize_unicode(attr) - if obj_type is datetime.datetime: - return self.serialize_iso(attr) - if obj_type is datetime.date: - return self.serialize_date(attr) - if obj_type is datetime.time: - return self.serialize_time(attr) - if obj_type is datetime.timedelta: - return self.serialize_duration(attr) - if obj_type is decimal.Decimal: - return self.serialize_decimal(attr) - - # If it's a model or I know this dependency, serialize as a Model - if obj_type in self.dependencies.values() or isinstance(attr, Model): - return self._serialize(attr) - - if obj_type == dict: - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) - except ValueError: - serialized[self.serialize_unicode(key)] = None - return serialized - - if obj_type == list: - serialized = [] - for obj in attr: - try: - serialized.append(self.serialize_object(obj, **kwargs)) - except ValueError: - pass - return serialized - return str(attr) - - @staticmethod - def serialize_enum(attr, enum_obj=None): - try: - result = attr.value - except AttributeError: - result = attr - try: - enum_obj(result) # type: ignore - return result - except ValueError as exc: - for enum_value in enum_obj: # type: ignore - if enum_value.value.lower() == str(attr).lower(): - return enum_value.value - error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) from exc - - @staticmethod - def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument - """Serialize bytearray into base-64 string. - - :param str attr: Object to be serialized. - :rtype: str - :return: serialized base64 - """ - return b64encode(attr).decode() - - @staticmethod - def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument - """Serialize str into base-64 string. - - :param str attr: Object to be serialized. - :rtype: str - :return: serialized base64 - """ - encoded = b64encode(attr).decode("ascii") - return encoded.strip("=").replace("+", "-").replace("/", "_") - - @staticmethod - def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Decimal object to float. - - :param decimal attr: Object to be serialized. - :rtype: float - :return: serialized decimal - """ - return float(attr) - - @staticmethod - def serialize_long(attr, **kwargs): # pylint: disable=unused-argument - """Serialize long (Py2) or int (Py3). - - :param int attr: Object to be serialized. - :rtype: int/long - :return: serialized long - """ - return _long_type(attr) - - @staticmethod - def serialize_date(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Date object into ISO-8601 formatted string. - - :param Date attr: Object to be serialized. - :rtype: str - :return: serialized date - """ - if isinstance(attr, str): - attr = isodate.parse_date(attr) - t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) - return t - - @staticmethod - def serialize_time(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Time object into ISO-8601 formatted string. - - :param datetime.time attr: Object to be serialized. - :rtype: str - :return: serialized time - """ - if isinstance(attr, str): - attr = isodate.parse_time(attr) - t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) - if attr.microsecond: - t += ".{:02}".format(attr.microsecond) - return t - - @staticmethod - def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument - """Serialize TimeDelta object into ISO-8601 formatted string. - - :param TimeDelta attr: Object to be serialized. - :rtype: str - :return: serialized duration - """ - if isinstance(attr, str): - attr = isodate.parse_duration(attr) - return isodate.duration_isoformat(attr) - - @staticmethod - def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Datetime object into RFC-1123 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises TypeError: if format invalid. - :return: serialized rfc - """ - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - except AttributeError as exc: - raise TypeError("RFC1123 object must be valid Datetime object.") from exc - - return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( - Serializer.days[utc.tm_wday], - utc.tm_mday, - Serializer.months[utc.tm_mon], - utc.tm_year, - utc.tm_hour, - utc.tm_min, - utc.tm_sec, - ) - - @staticmethod - def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Datetime object into ISO-8601 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises SerializationError: if format invalid. - :return: serialized iso - """ - if isinstance(attr, str): - attr = isodate.parse_datetime(attr) - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - if utc.tm_year > 9999 or utc.tm_year < 1: - raise OverflowError("Hit max or min date") - - microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") - if microseconds: - microseconds = "." + microseconds - date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( - utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec - ) - return date + microseconds + "Z" - except (ValueError, OverflowError) as err: - msg = "Unable to serialize datetime object." - raise SerializationError(msg) from err - except AttributeError as err: - msg = "ISO-8601 object must be valid Datetime object." - raise TypeError(msg) from err - - @staticmethod - def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param Datetime attr: Object to be serialized. - :rtype: int - :raises SerializationError: if format invalid - :return: serialied unix - """ - if isinstance(attr, int): - return attr - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - return int(calendar.timegm(attr.utctimetuple())) - except AttributeError as exc: - raise TypeError("Unix time object must be valid Datetime object.") from exc - - -def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument - key = attr_desc["key"] - working_data = data - - while "." in key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(list[str], _FLATTEN.split(key)) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = working_data.get(working_key, data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - return working_data.get(key) - - -def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements - attr, attr_desc, data -): - key = attr_desc["key"] - working_data = data - - while "." in key: - dict_keys = _FLATTEN.split(key) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - if working_data: - return attribute_key_case_insensitive_extractor(key, None, working_data) - - -def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument - """Extract the attribute in "data" based on the last part of the JSON path key. - - :param str attr: The attribute to extract - :param dict attr_desc: The attribute description - :param dict data: The data to extract from - :rtype: object - :returns: The extracted attribute - """ - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_extractor(dict_keys[-1], None, data) - - -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument - """Extract the attribute in "data" based on the last part of the JSON path key. - - This is the case insensitive version of "last_rest_key_extractor" - :param str attr: The attribute to extract - :param dict attr_desc: The attribute description - :param dict data: The data to extract from - :rtype: object - :returns: The extracted attribute - """ - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) - - -def attribute_key_extractor(attr, _, data): - return data.get(attr) - - -def attribute_key_case_insensitive_extractor(attr, _, data): - found_key = None - lower_attr = attr.lower() - for key in data: - if lower_attr == key.lower(): - found_key = key - break - - return data.get(found_key) - - -def _extract_name_from_internal_type(internal_type): - """Given an internal type XML description, extract correct XML name with namespace. - - :param dict internal_type: An model type - :rtype: tuple - :returns: A tuple XML name + namespace dict - """ - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - xml_name = internal_type_xml_map.get("name", internal_type.__name__) - xml_ns = internal_type_xml_map.get("ns", None) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - return xml_name - - -def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements - if isinstance(data, dict): - return None - - # Test if this model is XML ready first - if not isinstance(data, ET.Element): - return None - - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - - # Look for a children - is_iter_type = attr_desc["type"].startswith("[") - is_wrapped = xml_desc.get("wrapped", False) - internal_type = attr_desc.get("internalType", None) - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - - # Integrate namespace if necessary - xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - - # If it's an attribute, that's simple - if xml_desc.get("attr", False): - return data.get(xml_name) - - # If it's x-ms-text, that's simple too - if xml_desc.get("text", False): - return data.text - - # Scenario where I take the local name: - # - Wrapped node - # - Internal type is an enum (considered basic types) - # - Internal type has no XML/Name node - if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): - children = data.findall(xml_name) - # If internal type has a local name and it's not a list, I use that name - elif not is_iter_type and internal_type and "name" in internal_type_xml_map: - xml_name = _extract_name_from_internal_type(internal_type) - children = data.findall(xml_name) - # That's an array - else: - if internal_type: # Complex type, ignore itemsName and use the complex type name - items_name = _extract_name_from_internal_type(internal_type) - else: - items_name = xml_desc.get("itemsName", xml_name) - children = data.findall(items_name) - - if len(children) == 0: - if is_iter_type: - if is_wrapped: - return None # is_wrapped no node, we want None - return [] # not wrapped, assume empty list - return None # Assume it's not there, maybe an optional node. - - # If is_iter_type and not wrapped, return all found children - if is_iter_type: - if not is_wrapped: - return children - # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) - ) - return list(children[0]) # Might be empty list and that's ok. - - # Here it's not a itertype, we should have found one element only or empty - if len(children) > 1: - raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) - return children[0] - - -class Deserializer: - """Response object model deserializer. - - :param dict classes: Class type dictionary for deserializing complex types. - :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. - """ - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - - def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: - self.deserialize_type = { - "iso-8601": Deserializer.deserialize_iso, - "rfc-1123": Deserializer.deserialize_rfc, - "unix-time": Deserializer.deserialize_unix, - "duration": Deserializer.deserialize_duration, - "date": Deserializer.deserialize_date, - "time": Deserializer.deserialize_time, - "decimal": Deserializer.deserialize_decimal, - "long": Deserializer.deserialize_long, - "bytearray": Deserializer.deserialize_bytearray, - "base64": Deserializer.deserialize_base64, - "object": self.deserialize_object, - "[]": self.deserialize_iter, - "{}": self.deserialize_dict, - } - self.deserialize_expected_types = { - "duration": (isodate.Duration, datetime.timedelta), - "iso-8601": (datetime.datetime), - } - self.dependencies: dict[str, type] = dict(classes) if classes else {} - self.key_extractors = [rest_key_extractor, xml_key_extractor] - # Additional properties only works if the "rest_key_extractor" is used to - # extract the keys. Making it to work whatever the key extractor is too much - # complicated, with no real scenario for now. - # So adding a flag to disable additional properties detection. This flag should be - # used if your expect the deserialization to NOT come from a JSON REST syntax. - # Otherwise, result are unexpected - self.additional_properties_detection = True - - def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements - """Call the deserializer to process a REST response. - - :param str target_obj: Target data type to deserialize to. - :param requests.Response response_data: REST response object. - :param str content_type: Swagger "produces" if available. - :raises DeserializationError: if deserialization fails. - :return: Deserialized object. - :rtype: object - """ - # Fast path for header deserialization: response_data is a plain str or None - # and target_obj is a simple scalar type. This avoids the expensive - # _unpack_content → _deserialize → _classify_target → deserialize_data chain. - if response_data is None: - return None - if target_obj == "str" and isinstance(response_data, str): - return response_data - if isinstance(response_data, str): - if target_obj == "int": - return int(response_data) - if target_obj == "bool": - if response_data in ("true", "1", "True"): - return True - if response_data in ("false", "0", "False"): - return False - return bool(response_data) - if target_obj == "rfc-1123": - return Deserializer.deserialize_rfc(response_data) - if target_obj == "bytearray": - return Deserializer.deserialize_bytearray(response_data) - - data = self._unpack_content(response_data, content_type) - return self._deserialize(target_obj, data) - - def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements - """Call the deserializer on a model. - - Data needs to be already deserialized as JSON or XML ElementTree - - :param str target_obj: Target data type to deserialize to. - :param object data: Object to deserialize. - :raises DeserializationError: if deserialization fails. - :return: Deserialized object. - :rtype: object - """ - # This is already a model, go recursive just in case - if hasattr(data, "_attribute_map"): - constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] - try: - for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access - if attr in constants: - continue - value = getattr(data, attr) - if value is None: - continue - local_type = mapconfig["type"] - internal_data_type = local_type.strip("[]{}") - if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): - continue - setattr(data, attr, self._deserialize(local_type, value)) - return data - except AttributeError: - return - - response, class_name = self._classify_target(target_obj, data) - - if isinstance(response, str): - return self.deserialize_data(data, response) - if isinstance(response, type) and issubclass(response, Enum): - return self.deserialize_enum(data, response) - - if data is None or data is CoreNull: - return data - try: - attributes = response._attribute_map # type: ignore # pylint: disable=protected-access - d_attrs = {} - for attr, attr_desc in attributes.items(): - # Check empty string. If it's not empty, someone has a real "additionalProperties"... - if attr == "additional_properties" and attr_desc["key"] == "": - continue - raw_value = None - # Enhance attr_desc with some dynamic data - attr_desc = attr_desc.copy() # Do a copy, do not change the real one - internal_data_type = attr_desc["type"].strip("[]{}") - if internal_data_type in self.dependencies: - attr_desc["internalType"] = self.dependencies[internal_data_type] - - for key_extractor in self.key_extractors: - found_value = key_extractor(attr, attr_desc, data) - if found_value is not None: - if raw_value is not None and raw_value != found_value: - msg = ( - "Ignoring extracted value '%s' from %s for key '%s'" - " (duplicate extraction, follow extractors order)" - ) - _LOGGER.warning(msg, found_value, key_extractor, attr) - continue - raw_value = found_value - - value = self.deserialize_data(raw_value, attr_desc["type"]) - d_attrs[attr] = value - except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name # type: ignore - raise DeserializationError(msg) from err - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) - - def _build_additional_properties(self, attribute_map, data): - if not self.additional_properties_detection: - return None - if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": - # Check empty string. If it's not empty, someone has a real "additionalProperties" - return None - if isinstance(data, ET.Element): - data = {el.tag: el.text for el in data} - - known_keys = { - _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) - for desc in attribute_map.values() - if desc["key"] != "" - } - present_keys = set(data.keys()) - missing_keys = present_keys - known_keys - return {key: data[key] for key in missing_keys} - - def _classify_target(self, target, data): - """Check to see whether the deserialization target object can - be classified into a subclass. - Once classification has been determined, initialize object. - - :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - :return: The classified target object and its class name. - :rtype: tuple - """ - if target is None: - return None, None - - if isinstance(target, str): - try: - target = self.dependencies[target] - except KeyError: - return target, target - - try: - target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access - except AttributeError: - pass # Target is not a Model, no classify - return target, target.__class__.__name__ # type: ignore - - def failsafe_deserialize(self, target_obj, data, content_type=None): - """Ignores any errors encountered in deserialization, - and falls back to not deserializing the object. Recommended - for use in error deserialization, as we want to return the - HttpResponseError to users, and not have them deal with - a deserialization error. - - :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - :param str content_type: Swagger "produces" if available. - :return: Deserialized object. - :rtype: object - """ - try: - return self(target_obj, data, content_type=content_type) - except: # pylint: disable=bare-except - _LOGGER.debug( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - @staticmethod - def _unpack_content(raw_data, content_type=None): - """Extract the correct structure for deserialization. - - If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. - if we can't, raise. Your Pipeline should have a RawDeserializer. - - If not a pipeline response and raw_data is bytes or string, use content-type - to decode it. If no content-type, try JSON. - - If raw_data is something else, bypass all logic and return it directly. - - :param obj raw_data: Data to be processed. - :param str content_type: How to parse if raw_data is a string/bytes. - :raises JSONDecodeError: If JSON is requested and parsing is impossible. - :raises UnicodeDecodeError: If bytes is not UTF8 - :rtype: object - :return: Unpacked content. - """ - # Assume this is enough to detect a Pipeline Response without importing it - context = getattr(raw_data, "context", {}) - if context: - if RawDeserializer.CONTEXT_NAME in context: - return context[RawDeserializer.CONTEXT_NAME] - raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") - - # Assume this is enough to recognize universal_http.ClientResponse without importing it - if hasattr(raw_data, "body"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) - - # Assume this enough to recognize requests.Response without importing it. - if hasattr(raw_data, "_content_consumed"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - - if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore - return raw_data - - def _instantiate_model(self, response, attrs, additional_properties=None): - """Instantiate a response model passing in deserialized args. - - :param Response response: The response model class. - :param dict attrs: The deserialized response attributes. - :param dict additional_properties: Additional properties to be set. - :rtype: Response - :return: The instantiated response model. - """ - if callable(response): - subtype = getattr(response, "_subtype_map", {}) - try: - readonly = [ - k - for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore - if v.get("readonly") - ] - const = [ - k - for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore - if v.get("constant") - ] - kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} - response_obj = response(**kwargs) - for attr in readonly: - setattr(response_obj, attr, attrs.get(attr)) - if additional_properties: - response_obj.additional_properties = additional_properties # type: ignore - return response_obj - except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) from err - else: - try: - for attr, value in attrs.items(): - setattr(response, attr, value) - return response - except Exception as exp: - msg = "Unable to populate response model. " - msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) from exp - - def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements - """Process data for deserialization according to data type. - - :param str data: The response string to be deserialized. - :param str data_type: The type to deserialize to. - :raises DeserializationError: if deserialization fails. - :return: Deserialized object. - :rtype: object - """ - if data is None: - return data - - try: - if not data_type: - return data - if data_type in self.basic_types.values(): - return self.deserialize_basic(data, data_type) - if data_type in self.deserialize_type: - if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): - return data - - is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment - "object", - "[]", - r"{}", - ] - if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: - return None - data_val = self.deserialize_type[data_type](data) - return data_val - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.deserialize_type: - return self.deserialize_type[iter_type](data, data_type[1:-1]) - - obj_type = self.dependencies[data_type] - if issubclass(obj_type, Enum): - if isinstance(data, ET.Element): - data = data.text - return self.deserialize_enum(data, obj_type) - - except (ValueError, TypeError, AttributeError) as err: - msg = "Unable to deserialize response data." - msg += " Data: {}, {}".format(data, data_type) - raise DeserializationError(msg) from err - return self._deserialize(obj_type, data) - - def deserialize_iter(self, attr, iter_type): - """Deserialize an iterable. - - :param list attr: Iterable to be deserialized. - :param str iter_type: The type of object in the iterable. - :return: Deserialized iterable. - :rtype: list - """ - if attr is None: - return None - if isinstance(attr, ET.Element): # If I receive an element here, get the children - attr = list(attr) - if not isinstance(attr, (list, set)): - raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) - return [self.deserialize_data(a, iter_type) for a in attr] - - def deserialize_dict(self, attr, dict_type): - """Deserialize a dictionary. - - :param dict/list attr: Dictionary to be deserialized. Also accepts - a list of key, value pairs. - :param str dict_type: The object type of the items in the dictionary. - :return: Deserialized dictionary. - :rtype: dict - """ - if isinstance(attr, list): - return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} - - if isinstance(attr, ET.Element): - # Transform value into {"Key": "value"} - attr = {el.tag: el.text for el in attr} - return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - - def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements - """Deserialize a generic object. - This will be handled as a dictionary. - - :param dict attr: Dictionary to be deserialized. - :return: Deserialized object. - :rtype: dict - :raises TypeError: if non-builtin datatype encountered. - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - # Do no recurse on XML, just return the tree as-is - return attr - if isinstance(attr, str): - return self.deserialize_basic(attr, "str") - obj_type = type(attr) - if obj_type in self.basic_types: - return self.deserialize_basic(attr, self.basic_types[obj_type]) - if obj_type is _long_type: - return self.deserialize_long(attr) - - if obj_type == dict: - deserialized = {} - for key, value in attr.items(): - try: - deserialized[key] = self.deserialize_object(value, **kwargs) - except ValueError: - deserialized[key] = None - return deserialized - - if obj_type == list: - deserialized = [] - for obj in attr: - try: - deserialized.append(self.deserialize_object(obj, **kwargs)) - except ValueError: - pass - return deserialized - - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) - - def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements - """Deserialize basic builtin data type from string. - Will attempt to convert to str, int, float and bool. - This function will also accept '1', '0', 'true' and 'false' as - valid bool values. - - :param str attr: response string to be deserialized. - :param str data_type: deserialization data type. - :return: Deserialized basic type. - :rtype: str, int, float or bool - :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. - """ - # If we're here, data is supposed to be a basic type. - # If it's still an XML node, take the text - if isinstance(attr, ET.Element): - attr = attr.text - if not attr: - if data_type == "str": - # None or '', node is empty string. - return "" - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None - - if data_type == "bool": - if attr in [True, False, 1, 0]: - return bool(attr) - if isinstance(attr, str): - if attr.lower() in ["true", "1"]: - return True - if attr.lower() in ["false", "0"]: - return False - raise TypeError("Invalid boolean value: {}".format(attr)) - - if data_type == "str": - return self.deserialize_unicode(attr) - if data_type == "int": - return int(attr) - if data_type == "float": - return float(attr) - raise TypeError("Unknown basic data type: {}".format(data_type)) - - @staticmethod - def deserialize_unicode(data): - """Preserve unicode objects in Python 2, otherwise return data - as a string. - - :param str data: response string to be deserialized. - :return: Deserialized string. - :rtype: str or unicode - """ - # We might be here because we have an enum modeled as string, - # and we try to deserialize a partial dict with enum inside - if isinstance(data, Enum): - return data - - # Consider this is real string - try: - if isinstance(data, unicode): # type: ignore - return data - except NameError: - return str(data) - return str(data) - - @staticmethod - def deserialize_enum(data, enum_obj): - """Deserialize string into enum object. - - If the string is not a valid enum value it will be returned as-is - and a warning will be logged. - - :param str data: Response string to be deserialized. If this value is - None or invalid it will be returned as-is. - :param Enum enum_obj: Enum object to deserialize to. - :return: Deserialized enum object. - :rtype: Enum - """ - if isinstance(data, enum_obj) or data is None: - return data - if isinstance(data, Enum): - data = data.value - if isinstance(data, int): - # Workaround. We might consider remove it in the future. - try: - return list(enum_obj.__members__.values())[data] - except IndexError as exc: - error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) from exc - try: - return enum_obj(str(data)) - except ValueError: - for enum_value in enum_obj: - if enum_value.value.lower() == str(data).lower(): - return enum_value - # We don't fail anymore for unknown value, we deserialize as a string - _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) - return Deserializer.deserialize_unicode(data) - - @staticmethod - def deserialize_bytearray(attr): - """Deserialize string into bytearray. - - :param str attr: response string to be deserialized. - :return: Deserialized bytearray - :rtype: bytearray - :raises TypeError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return bytearray(b64decode(attr)) # type: ignore - - @staticmethod - def deserialize_base64(attr): - """Deserialize base64 encoded string into string. - - :param str attr: response string to be deserialized. - :return: Deserialized base64 string - :rtype: bytearray - :raises TypeError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return b64decode(encoded) - - @staticmethod - def deserialize_decimal(attr): - """Deserialize string into Decimal object. - - :param str attr: response string to be deserialized. - :return: Deserialized decimal - :raises DeserializationError: if string format invalid. - :rtype: decimal - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - return decimal.Decimal(str(attr)) # type: ignore - except decimal.DecimalException as err: - msg = "Invalid decimal {}".format(attr) - raise DeserializationError(msg) from err - - @staticmethod - def deserialize_long(attr): - """Deserialize string into long (Py2) or int (Py3). - - :param str attr: response string to be deserialized. - :return: Deserialized int - :rtype: long or int - :raises ValueError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return _long_type(attr) # type: ignore - - @staticmethod - def deserialize_duration(attr): - """Deserialize ISO-8601 formatted string into TimeDelta object. - - :param str attr: response string to be deserialized. - :return: Deserialized duration - :rtype: TimeDelta - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - duration = isodate.parse_duration(attr) - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize duration object." - raise DeserializationError(msg) from err - return duration - - @staticmethod - def deserialize_date(attr): - """Deserialize ISO-8601 formatted string into Date object. - - :param str attr: response string to be deserialized. - :return: Deserialized date - :rtype: Date - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=0, defaultday=0) - - @staticmethod - def deserialize_time(attr): - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :return: Deserialized time - :rtype: datetime.time - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - return isodate.parse_time(attr) - - @staticmethod - def deserialize_rfc(attr): - """Deserialize RFC-1123 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :return: Deserialized RFC datetime - :rtype: Datetime - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - parsed_date = email.utils.parsedate_tz(attr) # type: ignore - date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) - ) - if not date_obj.tzinfo: - date_obj = date_obj.astimezone(tz=TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to rfc datetime object." - raise DeserializationError(msg) from err - return date_obj - - @staticmethod - def deserialize_iso(attr): - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :return: Deserialized ISO datetime - :rtype: Datetime - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - attr = attr.upper() # type: ignore - match = Deserializer.valid_date.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize datetime object." - raise DeserializationError(msg) from err - return date_obj - - @staticmethod - def deserialize_unix(attr): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param int attr: Object to be serialized. - :return: Deserialized datetime - :rtype: Datetime - :raises DeserializationError: if format invalid - """ - if isinstance(attr, ET.Element): - attr = int(attr.text) # type: ignore - try: - attr = int(attr) - date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to unix datetime object." - raise DeserializationError(msg) from err - return date_obj diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_version.py deleted file mode 100644 index be71c81bd282..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "1.0.0b1" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/__init__.py deleted file mode 100644 index 86875893a227..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import MachineLearningServicesMgmtClient # type: ignore - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "MachineLearningServicesMgmtClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_client.py deleted file mode 100644 index f6a0ba3fe3c7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_client.py +++ /dev/null @@ -1,561 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -import sys -from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast - -from azure.core.pipeline import policies -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.settings import settings -from azure.mgmt.core import AsyncARMPipelineClient -from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy -from azure.mgmt.core.tools import get_arm_endpoints - -from .._utils.serialization import Deserializer, Serializer -from ._configuration import MachineLearningServicesMgmtClientConfiguration -from .operations import ( - BatchDeploymentsOperations, - BatchEndpointsOperations, - CapabilityHostsOperations, - CodeContainersOperations, - CodeVersionsOperations, - ComponentContainersOperations, - ComponentVersionsOperations, - ComputeOperations, - ConnectionOperations, - ConnectionRaiBlocklistItemOperations, - ConnectionRaiBlocklistItemsOperations, - ConnectionRaiBlocklistOperations, - ConnectionRaiBlocklistsOperations, - ConnectionRaiPoliciesOperations, - ConnectionRaiPolicyOperations, - DataContainersOperations, - DataVersionsOperations, - DatastoresOperations, - EndpointDeploymentOperations, - EndpointOperations, - EnvironmentContainersOperations, - EnvironmentVersionsOperations, - FeaturesOperations, - FeaturesetContainersOperations, - FeaturesetVersionsOperations, - FeaturestoreEntityContainersOperations, - FeaturestoreEntityVersionsOperations, - InferenceEndpointsOperations, - InferenceGroupsOperations, - InferencePoolsOperations, - JobsOperations, - ManagedNetworkProvisionsOperations, - ManagedNetworkSettingsOperations, - ManagedNetworkSettingsRuleOperations, - MarketplaceSubscriptionsOperations, - ModelContainersOperations, - ModelVersionsOperations, - OnlineDeploymentsOperations, - OnlineEndpointsOperations, - Operations, - OutboundRuleOperations, - OutboundRulesOperations, - PTUQuotaOperations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QuotasOperations, - RaiPoliciesOperations, - RaiPolicyOperations, - RegistriesOperations, - RegistryCodeContainersOperations, - RegistryCodeVersionsOperations, - RegistryComponentContainersOperations, - RegistryComponentVersionsOperations, - RegistryDataContainersOperations, - RegistryDataReferencesOperations, - RegistryDataVersionsOperations, - RegistryEnvironmentContainersOperations, - RegistryEnvironmentVersionsOperations, - RegistryModelContainersOperations, - RegistryModelVersionsOperations, - SchedulesOperations, - ServerlessEndpointsOperations, - UsagesOperations, - VirtualMachineSizesOperations, - WorkspaceConnectionsOperations, - WorkspaceFeaturesOperations, - WorkspacesOperations, -) - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self # type: ignore - -if TYPE_CHECKING: - from azure.core import AzureClouds - from azure.core.credentials_async import AsyncTokenCredential - - -class MachineLearningServicesMgmtClient: # pylint: disable=too-many-instance-attributes - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar operations: Operations operations - :vartype operations: azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.Operations - :ivar endpoint_deployment: EndpointDeploymentOperations operations - :vartype endpoint_deployment: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.EndpointDeploymentOperations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.WorkspacesOperations - :ivar code_containers: CodeContainersOperations operations - :vartype code_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.CodeContainersOperations - :ivar registries: RegistriesOperations operations - :vartype registries: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistriesOperations - :ivar code_versions: CodeVersionsOperations operations - :vartype code_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.CodeVersionsOperations - :ivar component_containers: ComponentContainersOperations operations - :vartype component_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ComponentContainersOperations - :ivar component_versions: ComponentVersionsOperations operations - :vartype component_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ComponentVersionsOperations - :ivar data_containers: DataContainersOperations operations - :vartype data_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.DataContainersOperations - :ivar data_versions: DataVersionsOperations operations - :vartype data_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.DataVersionsOperations - :ivar environment_containers: EnvironmentContainersOperations operations - :vartype environment_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.EnvironmentContainersOperations - :ivar environment_versions: EnvironmentVersionsOperations operations - :vartype environment_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.EnvironmentVersionsOperations - :ivar model_containers: ModelContainersOperations operations - :vartype model_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ModelContainersOperations - :ivar model_versions: ModelVersionsOperations operations - :vartype model_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ModelVersionsOperations - :ivar batch_endpoints: BatchEndpointsOperations operations - :vartype batch_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.BatchEndpointsOperations - :ivar batch_deployments: BatchDeploymentsOperations operations - :vartype batch_deployments: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.BatchDeploymentsOperations - :ivar capability_hosts: CapabilityHostsOperations operations - :vartype capability_hosts: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.CapabilityHostsOperations - :ivar datastores: DatastoresOperations operations - :vartype datastores: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.DatastoresOperations - :ivar featureset_containers: FeaturesetContainersOperations operations - :vartype featureset_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.FeaturesetContainersOperations - :ivar features: FeaturesOperations operations - :vartype features: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.FeaturesOperations - :ivar featureset_versions: FeaturesetVersionsOperations operations - :vartype featureset_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.FeaturesetVersionsOperations - :ivar featurestore_entity_containers: FeaturestoreEntityContainersOperations operations - :vartype featurestore_entity_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.FeaturestoreEntityContainersOperations - :ivar featurestore_entity_versions: FeaturestoreEntityVersionsOperations operations - :vartype featurestore_entity_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.FeaturestoreEntityVersionsOperations - :ivar inference_pools: InferencePoolsOperations operations - :vartype inference_pools: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.InferencePoolsOperations - :ivar inference_endpoints: InferenceEndpointsOperations operations - :vartype inference_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.InferenceEndpointsOperations - :ivar inference_groups: InferenceGroupsOperations operations - :vartype inference_groups: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.InferenceGroupsOperations - :ivar marketplace_subscriptions: MarketplaceSubscriptionsOperations operations - :vartype marketplace_subscriptions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.MarketplaceSubscriptionsOperations - :ivar online_endpoints: OnlineEndpointsOperations operations - :vartype online_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.OnlineEndpointsOperations - :ivar online_deployments: OnlineDeploymentsOperations operations - :vartype online_deployments: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.OnlineDeploymentsOperations - :ivar schedules: SchedulesOperations operations - :vartype schedules: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.SchedulesOperations - :ivar serverless_endpoints: ServerlessEndpointsOperations operations - :vartype serverless_endpoints: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ServerlessEndpointsOperations - :ivar rai_policy: RaiPolicyOperations operations - :vartype rai_policy: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RaiPolicyOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.PrivateEndpointConnectionsOperations - :ivar compute: ComputeOperations operations - :vartype compute: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ComputeOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.WorkspaceFeaturesOperations - :ivar connection: ConnectionOperations operations - :vartype connection: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ConnectionOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.PrivateLinkResourcesOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ManagedNetworkProvisionsOperations - :ivar registry_code_containers: RegistryCodeContainersOperations operations - :vartype registry_code_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryCodeContainersOperations - :ivar registry_data_references: RegistryDataReferencesOperations operations - :vartype registry_data_references: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryDataReferencesOperations - :ivar registry_code_versions: RegistryCodeVersionsOperations operations - :vartype registry_code_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryCodeVersionsOperations - :ivar registry_component_containers: RegistryComponentContainersOperations operations - :vartype registry_component_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryComponentContainersOperations - :ivar registry_component_versions: RegistryComponentVersionsOperations operations - :vartype registry_component_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryComponentVersionsOperations - :ivar registry_data_containers: RegistryDataContainersOperations operations - :vartype registry_data_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryDataContainersOperations - :ivar registry_data_versions: RegistryDataVersionsOperations operations - :vartype registry_data_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryDataVersionsOperations - :ivar registry_environment_containers: RegistryEnvironmentContainersOperations operations - :vartype registry_environment_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryEnvironmentContainersOperations - :ivar registry_environment_versions: RegistryEnvironmentVersionsOperations operations - :vartype registry_environment_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryEnvironmentVersionsOperations - :ivar registry_model_containers: RegistryModelContainersOperations operations - :vartype registry_model_containers: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryModelContainersOperations - :ivar registry_model_versions: RegistryModelVersionsOperations operations - :vartype registry_model_versions: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RegistryModelVersionsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.JobsOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.WorkspaceConnectionsOperations - :ivar connection_rai_blocklist: ConnectionRaiBlocklistOperations operations - :vartype connection_rai_blocklist: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ConnectionRaiBlocklistOperations - :ivar connection_rai_blocklists: ConnectionRaiBlocklistsOperations operations - :vartype connection_rai_blocklists: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ConnectionRaiBlocklistsOperations - :ivar connection_rai_blocklist_item: ConnectionRaiBlocklistItemOperations operations - :vartype connection_rai_blocklist_item: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ConnectionRaiBlocklistItemOperations - :ivar connection_rai_blocklist_items: ConnectionRaiBlocklistItemsOperations operations - :vartype connection_rai_blocklist_items: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ConnectionRaiBlocklistItemsOperations - :ivar connection_rai_policy: ConnectionRaiPolicyOperations operations - :vartype connection_rai_policy: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ConnectionRaiPolicyOperations - :ivar connection_rai_policies: ConnectionRaiPoliciesOperations operations - :vartype connection_rai_policies: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ConnectionRaiPoliciesOperations - :ivar rai_policies: RaiPoliciesOperations operations - :vartype rai_policies: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.RaiPoliciesOperations - :ivar endpoint: EndpointOperations operations - :vartype endpoint: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.EndpointOperations - :ivar managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar outbound_rule: OutboundRuleOperations operations - :vartype outbound_rule: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.OutboundRuleOperations - :ivar managed_network_settings: ManagedNetworkSettingsOperations operations - :vartype managed_network_settings: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.ManagedNetworkSettingsOperations - :ivar outbound_rules: OutboundRulesOperations operations - :vartype outbound_rules: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.OutboundRulesOperations - :ivar usages: UsagesOperations operations - :vartype usages: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.QuotasOperations - :ivar ptu_quota: PTUQuotaOperations operations - :vartype ptu_quota: - azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.operations.PTUQuotaOperations - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service host. Default value is None. - :type base_url: str - :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is - None. - :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2024-10-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - *, - cloud_setting: Optional["AzureClouds"] = None, - **kwargs: Any - ) -> None: - _endpoint = "{endpoint}" - _cloud = cloud_setting or settings.current.azure_cloud # type: ignore - _endpoints = get_arm_endpoints(_cloud) - if not base_url: - base_url = _endpoints["resource_manager"] - credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) - self._config = MachineLearningServicesMgmtClientConfiguration( - credential=credential, - subscription_id=subscription_id, - base_url=cast(str, base_url), - cloud_setting=cloud_setting, - credential_scopes=credential_scopes, - **kwargs - ) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - AsyncARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( - base_url=cast(str, _endpoint), policies=_policies, **kwargs - ) - - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint_deployment = EndpointDeploymentOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.component_versions = ComponentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.environment_versions = EnvironmentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.model_containers = ModelContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.capability_hosts = CapabilityHostsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.inference_pools = InferencePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.inference_endpoints = InferenceEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.inference_groups = InferenceGroupsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.marketplace_subscriptions = MarketplaceSubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.online_endpoints = OnlineEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.online_deployments = OnlineDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.serverless_endpoints = ServerlessEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.rai_policy = RaiPolicyOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection = ConnectionOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_network_provisions = ManagedNetworkProvisionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_code_containers = RegistryCodeContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_data_references = RegistryDataReferencesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_code_versions = RegistryCodeVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_component_containers = RegistryComponentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_component_versions = RegistryComponentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_data_containers = RegistryDataContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_data_versions = RegistryDataVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_environment_containers = RegistryEnvironmentContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_model_containers = RegistryModelContainersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.registry_model_versions = RegistryModelVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklist = ConnectionRaiBlocklistOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklists = ConnectionRaiBlocklistsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklist_item = ConnectionRaiBlocklistItemOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_blocklist_items = ConnectionRaiBlocklistItemsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_policy = ConnectionRaiPolicyOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connection_rai_policies = ConnectionRaiPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) - self.endpoint = EndpointOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.outbound_rule = OutboundRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings = ManagedNetworkSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.outbound_rules = OutboundRulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.ptu_quota = PTUQuotaOperations(self._client, self._config, self._serialize, self._deserialize) - - def send_request( - self, request: HttpRequest, *, stream: bool = False, **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> Self: - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_configuration.py deleted file mode 100644 index 2870dfabb204..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_configuration.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Optional, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - from azure.core import AzureClouds - from azure.core.credentials_async import AsyncTokenCredential - - -class MachineLearningServicesMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for MachineLearningServicesMgmtClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". - :type base_url: str - :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is - None. - :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2024-10-01-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. - :paramtype api_version: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - cloud_setting: Optional["AzureClouds"] = None, - **kwargs: Any - ) -> None: - api_version: str = kwargs.pop("api_version", "2024-10-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.base_url = base_url - self.cloud_setting = cloud_setting - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "ai-ml-_restclient-v2024_10_01_preview_tsp/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_patch.py deleted file mode 100644 index ea765788358a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/__init__.py deleted file mode 100644 index 83e90339d6d0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/__init__.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import Operations # type: ignore -from ._operations import EndpointDeploymentOperations # type: ignore -from ._operations import WorkspacesOperations # type: ignore -from ._operations import CodeContainersOperations # type: ignore -from ._operations import RegistriesOperations # type: ignore -from ._operations import CodeVersionsOperations # type: ignore -from ._operations import ComponentContainersOperations # type: ignore -from ._operations import ComponentVersionsOperations # type: ignore -from ._operations import DataContainersOperations # type: ignore -from ._operations import DataVersionsOperations # type: ignore -from ._operations import EnvironmentContainersOperations # type: ignore -from ._operations import EnvironmentVersionsOperations # type: ignore -from ._operations import ModelContainersOperations # type: ignore -from ._operations import ModelVersionsOperations # type: ignore -from ._operations import BatchEndpointsOperations # type: ignore -from ._operations import BatchDeploymentsOperations # type: ignore -from ._operations import CapabilityHostsOperations # type: ignore -from ._operations import DatastoresOperations # type: ignore -from ._operations import FeaturesetContainersOperations # type: ignore -from ._operations import FeaturesOperations # type: ignore -from ._operations import FeaturesetVersionsOperations # type: ignore -from ._operations import FeaturestoreEntityContainersOperations # type: ignore -from ._operations import FeaturestoreEntityVersionsOperations # type: ignore -from ._operations import InferencePoolsOperations # type: ignore -from ._operations import InferenceEndpointsOperations # type: ignore -from ._operations import InferenceGroupsOperations # type: ignore -from ._operations import MarketplaceSubscriptionsOperations # type: ignore -from ._operations import OnlineEndpointsOperations # type: ignore -from ._operations import OnlineDeploymentsOperations # type: ignore -from ._operations import SchedulesOperations # type: ignore -from ._operations import ServerlessEndpointsOperations # type: ignore -from ._operations import RaiPolicyOperations # type: ignore -from ._operations import PrivateEndpointConnectionsOperations # type: ignore -from ._operations import ComputeOperations # type: ignore -from ._operations import WorkspaceFeaturesOperations # type: ignore -from ._operations import ConnectionOperations # type: ignore -from ._operations import PrivateLinkResourcesOperations # type: ignore -from ._operations import ManagedNetworkProvisionsOperations # type: ignore -from ._operations import RegistryCodeContainersOperations # type: ignore -from ._operations import RegistryDataReferencesOperations # type: ignore -from ._operations import RegistryCodeVersionsOperations # type: ignore -from ._operations import RegistryComponentContainersOperations # type: ignore -from ._operations import RegistryComponentVersionsOperations # type: ignore -from ._operations import RegistryDataContainersOperations # type: ignore -from ._operations import RegistryDataVersionsOperations # type: ignore -from ._operations import RegistryEnvironmentContainersOperations # type: ignore -from ._operations import RegistryEnvironmentVersionsOperations # type: ignore -from ._operations import RegistryModelContainersOperations # type: ignore -from ._operations import RegistryModelVersionsOperations # type: ignore -from ._operations import JobsOperations # type: ignore -from ._operations import WorkspaceConnectionsOperations # type: ignore -from ._operations import ConnectionRaiBlocklistOperations # type: ignore -from ._operations import ConnectionRaiBlocklistsOperations # type: ignore -from ._operations import ConnectionRaiBlocklistItemOperations # type: ignore -from ._operations import ConnectionRaiBlocklistItemsOperations # type: ignore -from ._operations import ConnectionRaiPolicyOperations # type: ignore -from ._operations import ConnectionRaiPoliciesOperations # type: ignore -from ._operations import RaiPoliciesOperations # type: ignore -from ._operations import EndpointOperations # type: ignore -from ._operations import ManagedNetworkSettingsRuleOperations # type: ignore -from ._operations import OutboundRuleOperations # type: ignore -from ._operations import ManagedNetworkSettingsOperations # type: ignore -from ._operations import OutboundRulesOperations # type: ignore -from ._operations import UsagesOperations # type: ignore -from ._operations import VirtualMachineSizesOperations # type: ignore -from ._operations import QuotasOperations # type: ignore -from ._operations import PTUQuotaOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "EndpointDeploymentOperations", - "WorkspacesOperations", - "CodeContainersOperations", - "RegistriesOperations", - "CodeVersionsOperations", - "ComponentContainersOperations", - "ComponentVersionsOperations", - "DataContainersOperations", - "DataVersionsOperations", - "EnvironmentContainersOperations", - "EnvironmentVersionsOperations", - "ModelContainersOperations", - "ModelVersionsOperations", - "BatchEndpointsOperations", - "BatchDeploymentsOperations", - "CapabilityHostsOperations", - "DatastoresOperations", - "FeaturesetContainersOperations", - "FeaturesOperations", - "FeaturesetVersionsOperations", - "FeaturestoreEntityContainersOperations", - "FeaturestoreEntityVersionsOperations", - "InferencePoolsOperations", - "InferenceEndpointsOperations", - "InferenceGroupsOperations", - "MarketplaceSubscriptionsOperations", - "OnlineEndpointsOperations", - "OnlineDeploymentsOperations", - "SchedulesOperations", - "ServerlessEndpointsOperations", - "RaiPolicyOperations", - "PrivateEndpointConnectionsOperations", - "ComputeOperations", - "WorkspaceFeaturesOperations", - "ConnectionOperations", - "PrivateLinkResourcesOperations", - "ManagedNetworkProvisionsOperations", - "RegistryCodeContainersOperations", - "RegistryDataReferencesOperations", - "RegistryCodeVersionsOperations", - "RegistryComponentContainersOperations", - "RegistryComponentVersionsOperations", - "RegistryDataContainersOperations", - "RegistryDataVersionsOperations", - "RegistryEnvironmentContainersOperations", - "RegistryEnvironmentVersionsOperations", - "RegistryModelContainersOperations", - "RegistryModelVersionsOperations", - "JobsOperations", - "WorkspaceConnectionsOperations", - "ConnectionRaiBlocklistOperations", - "ConnectionRaiBlocklistsOperations", - "ConnectionRaiBlocklistItemOperations", - "ConnectionRaiBlocklistItemsOperations", - "ConnectionRaiPolicyOperations", - "ConnectionRaiPoliciesOperations", - "RaiPoliciesOperations", - "EndpointOperations", - "ManagedNetworkSettingsRuleOperations", - "OutboundRuleOperations", - "ManagedNetworkSettingsOperations", - "OutboundRulesOperations", - "UsagesOperations", - "VirtualMachineSizesOperations", - "QuotasOperations", - "PTUQuotaOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_operations.py deleted file mode 100644 index 9d525a8a17fa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_operations.py +++ /dev/null @@ -1,45652 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -import json -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ..._utils.serialization import Deserializer, Serializer -from ...operations._operations import ( - build_batch_deployments_create_or_update_request, - build_batch_deployments_delete_request, - build_batch_deployments_get_request, - build_batch_deployments_list_request, - build_batch_deployments_update_request, - build_batch_endpoints_create_or_update_request, - build_batch_endpoints_delete_request, - build_batch_endpoints_get_request, - build_batch_endpoints_list_keys_request, - build_batch_endpoints_list_request, - build_batch_endpoints_update_request, - build_capability_hosts_create_or_update_request, - build_capability_hosts_delete_request, - build_capability_hosts_get_request, - build_code_containers_create_or_update_request, - build_code_containers_delete_request, - build_code_containers_get_request, - build_code_containers_list_request, - build_code_versions_create_or_get_start_pending_upload_request, - build_code_versions_create_or_update_request, - build_code_versions_delete_request, - build_code_versions_get_request, - build_code_versions_list_request, - build_code_versions_publish_request, - build_component_containers_create_or_update_request, - build_component_containers_delete_request, - build_component_containers_get_request, - build_component_containers_list_request, - build_component_versions_create_or_update_request, - build_component_versions_delete_request, - build_component_versions_get_request, - build_component_versions_list_request, - build_component_versions_publish_request, - build_compute_create_or_update_request, - build_compute_delete_request, - build_compute_get_allowed_resize_sizes_request, - build_compute_get_request, - build_compute_list_keys_request, - build_compute_list_nodes_request, - build_compute_list_request, - build_compute_resize_request, - build_compute_restart_request, - build_compute_start_request, - build_compute_stop_request, - build_compute_update_custom_services_request, - build_compute_update_data_mounts_request, - build_compute_update_idle_shutdown_setting_request, - build_compute_update_request, - build_connection_create_or_update_deployment_request, - build_connection_delete_deployment_request, - build_connection_get_all_models_request, - build_connection_get_deployment_request, - build_connection_get_models_request, - build_connection_list_deployments_request, - build_connection_rai_blocklist_create_request, - build_connection_rai_blocklist_delete_request, - build_connection_rai_blocklist_get_request, - build_connection_rai_blocklist_item_add_bulk_request, - build_connection_rai_blocklist_item_create_request, - build_connection_rai_blocklist_item_delete_bulk_request, - build_connection_rai_blocklist_item_delete_request, - build_connection_rai_blocklist_item_get_request, - build_connection_rai_blocklist_items_list_request, - build_connection_rai_blocklists_list_request, - build_connection_rai_policies_list_request, - build_connection_rai_policy_create_request, - build_connection_rai_policy_delete_request, - build_connection_rai_policy_get_request, - build_data_containers_create_or_update_request, - build_data_containers_delete_request, - build_data_containers_get_request, - build_data_containers_list_request, - build_data_versions_create_or_update_request, - build_data_versions_delete_request, - build_data_versions_get_request, - build_data_versions_list_request, - build_data_versions_publish_request, - build_datastores_create_or_update_request, - build_datastores_delete_request, - build_datastores_get_request, - build_datastores_list_request, - build_datastores_list_secrets_request, - build_endpoint_create_or_update_request, - build_endpoint_deployment_create_or_update_request, - build_endpoint_deployment_delete_request, - build_endpoint_deployment_get_in_workspace_request, - build_endpoint_deployment_get_request, - build_endpoint_deployment_list_request, - build_endpoint_get_models_request, - build_endpoint_get_request, - build_endpoint_list_keys_request, - build_endpoint_list_request, - build_endpoint_regenerate_keys_request, - build_environment_containers_create_or_update_request, - build_environment_containers_delete_request, - build_environment_containers_get_request, - build_environment_containers_list_request, - build_environment_versions_create_or_update_request, - build_environment_versions_delete_request, - build_environment_versions_get_request, - build_environment_versions_list_request, - build_environment_versions_publish_request, - build_features_get_request, - build_features_list_request, - build_featureset_containers_create_or_update_request, - build_featureset_containers_delete_request, - build_featureset_containers_get_entity_request, - build_featureset_containers_list_request, - build_featureset_versions_backfill_request, - build_featureset_versions_create_or_update_request, - build_featureset_versions_delete_request, - build_featureset_versions_get_request, - build_featureset_versions_list_request, - build_featurestore_entity_containers_create_or_update_request, - build_featurestore_entity_containers_delete_request, - build_featurestore_entity_containers_get_entity_request, - build_featurestore_entity_containers_list_request, - build_featurestore_entity_versions_create_or_update_request, - build_featurestore_entity_versions_delete_request, - build_featurestore_entity_versions_get_request, - build_featurestore_entity_versions_list_request, - build_inference_endpoints_create_or_update_request, - build_inference_endpoints_delete_request, - build_inference_endpoints_get_request, - build_inference_endpoints_list_request, - build_inference_endpoints_update_request, - build_inference_groups_create_or_update_request, - build_inference_groups_delete_request, - build_inference_groups_get_delta_models_status_async_request, - build_inference_groups_get_request, - build_inference_groups_get_status_request, - build_inference_groups_list_delta_models_async_request, - build_inference_groups_list_request, - build_inference_groups_list_skus_request, - build_inference_groups_modify_delta_models_async_request, - build_inference_groups_update_request, - build_inference_pools_create_or_update_request, - build_inference_pools_delete_request, - build_inference_pools_get_request, - build_inference_pools_list_request, - build_inference_pools_update_request, - build_jobs_cancel_request, - build_jobs_create_or_update_request, - build_jobs_delete_request, - build_jobs_get_request, - build_jobs_list_request, - build_managed_network_provisions_provision_managed_network_request, - build_managed_network_settings_get_request, - build_managed_network_settings_list_request, - build_managed_network_settings_patch_request, - build_managed_network_settings_put_request, - build_managed_network_settings_rule_create_or_update_request, - build_managed_network_settings_rule_delete_request, - build_managed_network_settings_rule_get_request, - build_managed_network_settings_rule_list_request, - build_marketplace_subscriptions_create_or_update_request, - build_marketplace_subscriptions_delete_request, - build_marketplace_subscriptions_get_request, - build_marketplace_subscriptions_list_request, - build_model_containers_create_or_update_request, - build_model_containers_delete_request, - build_model_containers_get_request, - build_model_containers_list_request, - build_model_versions_create_or_update_request, - build_model_versions_delete_request, - build_model_versions_get_request, - build_model_versions_list_request, - build_model_versions_publish_request, - build_online_deployments_create_or_update_request, - build_online_deployments_delete_request, - build_online_deployments_get_logs_request, - build_online_deployments_get_request, - build_online_deployments_list_request, - build_online_deployments_list_skus_request, - build_online_deployments_update_request, - build_online_endpoints_create_or_update_request, - build_online_endpoints_delete_request, - build_online_endpoints_get_request, - build_online_endpoints_get_token_request, - build_online_endpoints_list_keys_request, - build_online_endpoints_list_request, - build_online_endpoints_regenerate_keys_request, - build_online_endpoints_update_request, - build_operations_list_request, - build_outbound_rule_create_or_update_request, - build_outbound_rule_delete_request, - build_outbound_rule_get_request, - build_outbound_rule_list_request, - build_outbound_rules_post_request, - build_private_endpoint_connections_create_or_update_request, - build_private_endpoint_connections_delete_request, - build_private_endpoint_connections_get_request, - build_private_endpoint_connections_list_request, - build_private_link_resources_list_request, - build_ptu_quota_get_available_request, - build_ptu_quota_list_available_request, - build_ptu_quota_list_request, - build_quotas_list_request, - build_quotas_update_request, - build_rai_policies_list_request, - build_rai_policy_create_request, - build_rai_policy_delete_request, - build_rai_policy_get_request, - build_registries_create_or_update_request, - build_registries_delete_request, - build_registries_get_request, - build_registries_list_by_subscription_request, - build_registries_list_request, - build_registries_remove_regions_request, - build_registries_update_request, - build_registry_code_containers_create_or_update_request, - build_registry_code_containers_delete_request, - build_registry_code_containers_get_request, - build_registry_code_containers_list_request, - build_registry_code_versions_create_or_get_start_pending_upload_request, - build_registry_code_versions_create_or_update_request, - build_registry_code_versions_delete_request, - build_registry_code_versions_get_request, - build_registry_code_versions_list_request, - build_registry_component_containers_create_or_update_request, - build_registry_component_containers_delete_request, - build_registry_component_containers_get_request, - build_registry_component_containers_list_request, - build_registry_component_versions_create_or_update_request, - build_registry_component_versions_delete_request, - build_registry_component_versions_get_request, - build_registry_component_versions_list_request, - build_registry_data_containers_create_or_update_request, - build_registry_data_containers_delete_request, - build_registry_data_containers_get_request, - build_registry_data_containers_list_request, - build_registry_data_references_get_blob_reference_sas_request, - build_registry_data_versions_create_or_get_start_pending_upload_request, - build_registry_data_versions_create_or_update_request, - build_registry_data_versions_delete_request, - build_registry_data_versions_get_request, - build_registry_data_versions_list_request, - build_registry_environment_containers_create_or_update_request, - build_registry_environment_containers_delete_request, - build_registry_environment_containers_get_request, - build_registry_environment_containers_list_request, - build_registry_environment_versions_create_or_update_request, - build_registry_environment_versions_delete_request, - build_registry_environment_versions_get_request, - build_registry_environment_versions_list_request, - build_registry_model_containers_create_or_update_request, - build_registry_model_containers_delete_request, - build_registry_model_containers_get_request, - build_registry_model_containers_list_request, - build_registry_model_versions_create_or_get_start_pending_upload_request, - build_registry_model_versions_create_or_update_request, - build_registry_model_versions_delete_request, - build_registry_model_versions_get_request, - build_registry_model_versions_list_request, - build_schedules_create_or_update_request, - build_schedules_delete_request, - build_schedules_get_request, - build_schedules_list_request, - build_serverless_endpoints_create_or_update_request, - build_serverless_endpoints_delete_request, - build_serverless_endpoints_get_request, - build_serverless_endpoints_list_keys_request, - build_serverless_endpoints_list_request, - build_serverless_endpoints_regenerate_keys_request, - build_serverless_endpoints_update_request, - build_usages_list_request, - build_virtual_machine_sizes_list_request, - build_workspace_connections_create_request, - build_workspace_connections_delete_request, - build_workspace_connections_get_request, - build_workspace_connections_list_request, - build_workspace_connections_list_secrets_request, - build_workspace_connections_test_connection_request, - build_workspace_connections_update_request, - build_workspace_features_list_request, - build_workspaces_create_or_update_request, - build_workspaces_delete_request, - build_workspaces_diagnose_request, - build_workspaces_get_request, - build_workspaces_list_by_resource_group_request, - build_workspaces_list_by_subscription_request, - build_workspaces_list_keys_request, - build_workspaces_list_notebook_access_token_request, - build_workspaces_list_notebook_keys_request, - build_workspaces_list_outbound_network_dependencies_endpoints_request, - build_workspaces_list_storage_account_keys_request, - build_workspaces_prepare_notebook_request, - build_workspaces_resync_keys_request, - build_workspaces_update_request, -) -from .._configuration import MachineLearningServicesMgmtClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] -List = list - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - List the operations for the provider. - - :return: An iterator like instance of Operation - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Operation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class EndpointDeploymentOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`endpoint_deployment` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> _models.EndpointDeploymentResourcePropertiesBasicResource: - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :return: EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_endpoint_deployment_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_endpoint_deployment_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.EndpointDeploymentResourcePropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Is one of the following types: - EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_endpoint_deployment_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - proxy_api_version=proxy_api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: An iterator like instance of EndpointDeploymentResourcePropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointDeploymentResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_deployment_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointDeploymentResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def get_in_workspace( - self, - resource_group_name: str, - workspace_name: str, - *, - endpoint_type: Optional[Union[str, _models.EndpointType]] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword endpoint_type: Endpoint type filter. Known values are: "Azure.OpenAI", "Azure.Speech", - "Azure.ContentSafety", "Azure.Llama", "managedOnlineEndpoint", and "serverlessEndpoint". - Default value is None. - :paramtype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointType - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of EndpointDeploymentResourcePropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointDeploymentResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_deployment_get_in_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - endpoint_type=endpoint_type, - skip=skip, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointDeploymentResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class WorkspacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`workspaces` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.Workspace: - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: Workspace. The Workspace is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) - - _request = build_workspaces_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Workspace, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.Workspace, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_workspaces_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: _models.Workspace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.Workspace, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Is one of - the following types: Workspace, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Workspace, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Workspace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Workspace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.WorkspaceUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_workspaces_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: _models.WorkspaceUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.WorkspaceUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Is one of the following - types: WorkspaceUpdateParameters, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceUpdateParameters - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Workspace, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Workspace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Workspace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, *, force_to_purge: bool = False, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_workspaces_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - force_to_purge=force_to_purge, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, *, force_to_purge: bool = False, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword force_to_purge: Flag to indicate delete is a purge request. Default value is False. - :paramtype force_to_purge: bool - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - *, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.Workspace"]: - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword kind: Kind of workspace. Default value is None. - :paramtype kind: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword ai_capabilities: Default value is None. - :paramtype ai_capabilities: str - :return: An iterator like instance of Workspace - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Workspace]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspaces_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Workspace], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription( - self, - *, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.Workspace"]: - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :keyword kind: Kind of workspace. Default value is None. - :paramtype kind: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword ai_capabilities: Default value is None. - :paramtype ai_capabilities: str - :return: An iterator like instance of Workspace - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Workspace]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspaces_list_by_subscription_request( - subscription_id=self._config.subscription_id, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Workspace], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.DiagnoseWorkspaceParameters, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspaces_diagnose_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[_models.DiagnoseWorkspaceParameters] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseWorkspaceParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.DiagnoseWorkspaceParameters, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Is one of the following types: - DiagnoseWorkspaceParameters, JSON, IO[bytes] Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseWorkspaceParameters - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.DiagnoseResponseResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DiagnoseResponseResult, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DiagnoseResponseResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DiagnoseResponseResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ListWorkspaceKeysResult: - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ListWorkspaceKeysResult. The ListWorkspaceKeysResult is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListWorkspaceKeysResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ListWorkspaceKeysResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ListWorkspaceKeysResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_notebook_access_token( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.NotebookAccessTokenResult: - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: NotebookAccessTokenResult. The NotebookAccessTokenResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotebookAccessTokenResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NotebookAccessTokenResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_notebook_access_token_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.NotebookAccessTokenResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_notebook_keys( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ListNotebookKeysResult: - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ListNotebookKeysResult. The ListNotebookKeysResult is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListNotebookKeysResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ListNotebookKeysResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_notebook_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ListNotebookKeysResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_storage_account_keys( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ListStorageAccountKeysResult: - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ListStorageAccountKeysResult. The ListStorageAccountKeysResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListStorageAccountKeysResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ListStorageAccountKeysResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_storage_account_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ListStorageAccountKeysResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ExternalFQDNResponse: - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ExternalFQDNResponse. The ExternalFQDNResponse is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ExternalFQDNResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ExternalFQDNResponse] = kwargs.pop("cls", None) - - _request = build_workspaces_list_outbound_network_dependencies_endpoints_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ExternalFQDNResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _prepare_notebook_initial( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_workspaces_prepare_notebook_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_prepare_notebook( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.NotebookResourceInfo]: - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An instance of AsyncLROPoller that returns NotebookResourceInfo. The - NotebookResourceInfo is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotebookResourceInfo] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NotebookResourceInfo] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NotebookResourceInfo, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.NotebookResourceInfo].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.NotebookResourceInfo]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _resync_keys_initial( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_workspaces_resync_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_resync_keys( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class CodeContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`code_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.CodeContainer: - """Get containers. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - - _request = build_code_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.CodeContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.CodeContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - CodeContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer or JSON or - IO[bytes] - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_code_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.CodeContainer"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of CodeContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_code_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registries` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> _models.Registry: - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - - _request = build_registries_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Registry, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: _models.Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Is one of the following types: Registry, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Registry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Registry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Registry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def update( - self, - resource_group_name: str, - registry_name: str, - body: _models.PartialRegistryPartialTrackedResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialRegistryPartialTrackedResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - registry_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - registry_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.PartialRegistryPartialTrackedResource, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Is one of the following types: - PartialRegistryPartialTrackedResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialRegistryPartialTrackedResource - or JSON or IO[bytes] - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Registry, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registries_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Registry"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of Registry - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registries_list_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Registry], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Registry"]: - """List registries by subscription. - - List registries by subscription. - - :return: An iterator like instance of Registry - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registries_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Registry], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_remove_regions_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: _models.Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Is one of the following types: Registry, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Registry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Registry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Registry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class CodeVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`code_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.CodeVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - - _request = build_code_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.CodeVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.CodeVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: CodeVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion or JSON or - IO[bytes] - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_code_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.CodeVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. Default value is None. - :paramtype hash: str - :keyword hash_version: Hash algorithm version when listing by hash. Default value is None. - :paramtype hash_version: str - :return: An iterator like instance of CodeVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_code_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ComponentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`component_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.ComponentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - - _request = build_component_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.ComponentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ComponentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - ComponentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer or JSON - or IO[bytes] - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_component_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_component_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ComponentContainer"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ComponentContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_component_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ComponentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`component_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.ComponentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - - _request = build_component_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.ComponentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.ComponentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - ComponentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion or JSON or - IO[bytes] - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_component_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_component_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ComponentVersion"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ComponentVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_component_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_component_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class DataContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`data_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.DataContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - - _request = build_data_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.DataContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.DataContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - DataContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer or JSON or - IO[bytes] - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_data_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DataContainer"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_data_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class DataVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`data_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.DataVersionBase: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - - _request = build_data_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataVersionBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DataVersionBase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DataVersionBase, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - DataVersionBase, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase or JSON or - IO[bytes] - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataVersionBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_data_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DataVersionBase"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :keyword order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. Default - value is None. - :paramtype order_by: str - :keyword top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count will be returned. Default - value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataVersionBase - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataVersionBase]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_data_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataVersionBase], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class EnvironmentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`environment_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.EnvironmentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - - _request = build_environment_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.EnvironmentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.EnvironmentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - EnvironmentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer or - JSON or IO[bytes] - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_environment_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_environment_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EnvironmentContainer"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_environment_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class EnvironmentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`environment_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.EnvironmentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - - _request = build_environment_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.EnvironmentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.EnvironmentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Is one of the following types: - EnvironmentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion or JSON - or IO[bytes] - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_environment_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_environment_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EnvironmentVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_environment_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_environment_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ModelContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`model_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.ModelContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - - _request = build_model_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.ModelContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ModelContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - ModelContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer or JSON or - IO[bytes] - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ModelContainer"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword count: Maximum number of results to return. Default value is None. - :paramtype count: int - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_model_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - count=count, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ModelVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`model_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.ModelVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - - _request = build_model_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.ModelVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion or JSON or - IO[bytes] - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( # pylint: disable=too-many-locals - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ModelVersion"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword version: Model version. Default value is None. - :paramtype version: str - :keyword description: Model description. Default value is None. - :paramtype description: str - :keyword offset: Number of initial results to skip. Default value is None. - :paramtype offset: int - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. Default value is None. - :paramtype properties: str - :keyword feed: Name of the feed. Default value is None. - :paramtype feed: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_model_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class BatchEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`batch_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.BatchEndpoint: - """Get batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :return: BatchEndpoint. The BatchEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.BatchEndpoint] = kwargs.pop("cls", None) - - _request = build_batch_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.BatchEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.BatchEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.BatchEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.BatchEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Is one of the following types: - BatchEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BatchEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BatchEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.PartialMinimalTrackedResourceWithIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Is one of the following types: - PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns BatchEndpoint. The BatchEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BatchEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BatchEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_batch_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.BatchEndpoint"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword count: Number of endpoints to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of BatchEndpoint - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.BatchEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_batch_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - count=count, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.BatchEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointAuthKeys: - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :return: EndpointAuthKeys. The EndpointAuthKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - - _request = build_batch_endpoints_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class BatchDeploymentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`batch_deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> _models.BatchDeployment: - """Get batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :return: BatchDeployment. The BatchDeployment is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.BatchDeployment] = kwargs.pop("cls", None) - - _request = build_batch_deployments_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.BatchDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.BatchDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_deployments_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.BatchDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.BatchDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Is one of the following types: - BatchDeployment, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchDeployment] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BatchDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BatchDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_deployments_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Is one of the following types: - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchDeployment] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BatchDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BatchDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_batch_deployments_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.BatchDeployment"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Top of list. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of BatchDeployment - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.BatchDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_batch_deployments_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.BatchDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class CapabilityHostsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`capability_hosts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.CapabilityHost: - """Get capabilityHost. - - Get capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :return: CapabilityHost. The CapabilityHost is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CapabilityHost] = kwargs.pop("cls", None) - - _request = build_capability_hosts_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CapabilityHost, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.CapabilityHost, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_capability_hosts_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.CapabilityHost, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CapabilityHost. The CapabilityHost is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CapabilityHost. The CapabilityHost is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CapabilityHost. The CapabilityHost is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.CapabilityHost, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Is one of the following types: CapabilityHost, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns CapabilityHost. The CapabilityHost is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CapabilityHost] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CapabilityHost, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CapabilityHost].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CapabilityHost]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_capability_hosts_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete capabilityHost. - - Delete capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class DatastoresOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`datastores` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.Datastore: - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) - - _request = build_datastores_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Datastore, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.Datastore, - *, - skip_validation: bool = False, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - skip_validation: bool = False, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Required. - :type body: JSON - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - skip_validation: bool = False, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Required. - :type body: IO[bytes] - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.Datastore, JSON, IO[bytes]], - *, - skip_validation: bool = False, - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Is one of the following types: Datastore, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore or JSON or - IO[bytes] - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_datastores_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip_validation=skip_validation, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Datastore, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_datastores_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - count: int = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: bool = False, - **kwargs: Any - ) -> AsyncItemPaged["_models.Datastore"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword count: Maximum number of results to return. Default value is 30. - :paramtype count: int - :keyword is_default: Filter down to the workspace default datastore. Default value is None. - :paramtype is_default: bool - :keyword names: Names of datastores to return. Default value is None. - :paramtype names: list[str] - :keyword search_text: Text to search for in the datastore names. Default value is None. - :paramtype search_text: str - :keyword order_by: Order by property (createdtime | modifiedtime | name). Default value is - None. - :paramtype order_by: str - :keyword order_by_asc: Order by property in ascending order. Default value is False. - :paramtype order_by_asc: bool - :return: An iterator like instance of Datastore - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Datastore]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_datastores_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Datastore], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[_models.SecretExpiry] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SecretExpiry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[Union[_models.SecretExpiry, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Is one of the following types: SecretExpiry, JSON, - IO[bytes] Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SecretExpiry or JSON or - IO[bytes] - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.DatastoreSecrets] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_datastores_list_secrets_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DatastoreSecrets, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class FeaturesetContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`featureset_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get_entity( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.FeaturesetContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: FeaturesetContainer. The FeaturesetContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturesetContainer] = kwargs.pop("cls", None) - - _request = build_featureset_containers_get_entity_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturesetContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturesetContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featureset_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.FeaturesetContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetContainer. The - FeaturesetContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetContainer. The - FeaturesetContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetContainer. The - FeaturesetContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturesetContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - FeaturesetContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns FeaturesetContainer. The - FeaturesetContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturesetContainer] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturesetContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.FeaturesetContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FeaturesetContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featureset_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.FeaturesetContainer"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword name: name for the featureset. Default value is None. - :paramtype name: str - :keyword description: description for the feature set. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :return: An iterator like instance of FeaturesetContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturesetContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featureset_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturesetContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class FeaturesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`features` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> _models.Feature: - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param featureset_name: Name of Azure Machine Learning featuresets. Required. - :type featureset_name: str - :param featureset_version: Inference Version name. Required. - :type featureset_version: str - :param feature_name: Inference FeatureName name. Required. - :type feature_name: str - :return: Feature. The Feature is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Feature - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Feature] = kwargs.pop("cls", None) - - _request = build_features_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Feature, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 1000, - **kwargs: Any - ) -> AsyncItemPaged["_models.Feature"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param featureset_name: Name of Azure Machine Learning featuresets. Required. - :type featureset_name: str - :param featureset_version: Inference Version name. Required. - :type featureset_version: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword feature_name: feature name. Default value is None. - :paramtype feature_name: str - :keyword description: Description of the featureset. Default value is None. - :paramtype description: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: Page size. Default value is 1000. - :paramtype page_size: int - :return: An iterator like instance of Feature - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Feature] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Feature]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_features_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Feature], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class FeaturesetVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`featureset_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.FeaturesetVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: FeaturesetVersion. The FeaturesetVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturesetVersion] = kwargs.pop("cls", None) - - _request = build_featureset_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturesetVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featureset_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.FeaturesetVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - FeaturesetVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturesetVersion] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturesetVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.FeaturesetVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FeaturesetVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featureset_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( # pylint: disable=too-many-locals - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.FeaturesetVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword version_name: name for the featureset version. Default value is None. - :paramtype version_name: str - :keyword version: featureset version. Default value is None. - :paramtype version: str - :keyword description: description for the feature set version. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :keyword stage: Specifies the featurestore stage. Default value is None. - :paramtype stage: str - :return: An iterator like instance of FeaturesetVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturesetVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featureset_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturesetVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersionBackfillRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featureset_versions_backfill_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.FeaturesetVersionBackfillRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersionBackfillRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Is one of the following types: - FeaturesetVersionBackfillRequest, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillRequest or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturesetVersionBackfillResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturesetVersionBackfillResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.FeaturesetVersionBackfillResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FeaturesetVersionBackfillResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class FeaturestoreEntityContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`featurestore_entity_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get_entity( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.FeaturestoreEntityContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: FeaturestoreEntityContainer. The FeaturestoreEntityContainer is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturestoreEntityContainer] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_containers_get_entity_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturestoreEntityContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturestoreEntityContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featurestore_entity_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.FeaturestoreEntityContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturestoreEntityContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - FeaturestoreEntityContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturestoreEntityContainer] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturestoreEntityContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.FeaturestoreEntityContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FeaturestoreEntityContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.FeaturestoreEntityContainer"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword name: name for the featurestore entity. Default value is None. - :paramtype name: str - :keyword description: description for the featurestore entity. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :return: An iterator like instance of FeaturestoreEntityContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturestoreEntityContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featurestore_entity_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturestoreEntityContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class FeaturestoreEntityVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`featurestore_entity_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.FeaturestoreEntityVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: FeaturestoreEntityVersion. The FeaturestoreEntityVersion is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturestoreEntityVersion] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturestoreEntityVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturestoreEntityVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featurestore_entity_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.FeaturestoreEntityVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturestoreEntityVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - FeaturestoreEntityVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturestoreEntityVersion] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturestoreEntityVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.FeaturestoreEntityVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FeaturestoreEntityVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( # pylint: disable=too-many-locals - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.FeaturestoreEntityVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword version_name: name for the featurestore entity version. Default value is None. - :paramtype version_name: str - :keyword version: featurestore entity version. Default value is None. - :paramtype version: str - :keyword description: description for the feature entity version. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :keyword stage: Specifies the featurestore stage. Default value is None. - :paramtype stage: str - :return: An iterator like instance of FeaturestoreEntityVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturestoreEntityVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featurestore_entity_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturestoreEntityVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class InferencePoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`inference_pools` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, inference_pool_name: str, **kwargs: Any - ) -> _models.InferencePool: - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :return: InferencePool. The InferencePool is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferencePool] = kwargs.pop("cls", None) - - _request = build_inference_pools_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.InferencePool, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.InferencePool, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_pools_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: _models.InferencePool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.InferencePool, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Is one of the following types: - InferencePool, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferencePool] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferencePool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.InferencePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InferencePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_pools_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: _models.PartialMinimalTrackedResourceWithSkuAndIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns InferencePool. The InferencePool is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferencePool] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferencePool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.InferencePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InferencePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, inference_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_pools_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, inference_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.InferencePool"]: - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword count: Number of inferencePools to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of InferencePool - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.InferencePool]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_pools_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.InferencePool], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class InferenceEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`inference_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.InferenceEndpoint: - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :return: InferenceEndpoint. The InferenceEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferenceEndpoint] = kwargs.pop("cls", None) - - _request = build_inference_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.InferenceEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Union[_models.InferenceEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: _models.InferenceEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Union[_models.InferenceEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Is one of the following types: - InferenceEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferenceEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.InferenceEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InferenceEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceEndpoint]: - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :return: An instance of AsyncLROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferenceEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.InferenceEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InferenceEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.InferenceEndpoint"]: - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :keyword count: Number of InferenceEndpoint to be retrieved in a page of results. Default value - is None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of InferenceEndpoint - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.InferenceEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.InferenceEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class InferenceGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`inference_groups` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> _models.InferenceGroup: - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :return: InferenceGroup. The InferenceGroup is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferenceGroup] = kwargs.pop("cls", None) - - _request = build_inference_groups_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.InferenceGroup, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.InferenceGroup, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.InferenceGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.InferenceGroup, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Is one of the following types: - InferenceGroup, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferenceGroup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceGroup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.InferenceGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InferenceGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.PartialMinimalTrackedResourceWithSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithSku, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns InferenceGroup. The InferenceGroup is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferenceGroup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceGroup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.InferenceGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InferenceGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_groups_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.InferenceGroup"]: - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :keyword count: Number of InferenceGroup to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of InferenceGroup - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.InferenceGroup]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_groups_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.InferenceGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.DeltaModelStatusRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelStatusRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Is one of the following types: DeltaModelStatusRequest, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusRequest or - JSON or IO[bytes] - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeltaModelStatusResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_get_delta_models_status_async_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeltaModelStatusResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.DeltaModelListRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelListRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of str - :rtype: ~azure.core.async_paging.AsyncItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of str - :rtype: ~azure.core.async_paging.AsyncItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of str - :rtype: ~azure.core.async_paging.AsyncItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelListRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Is one of the following types: DeltaModelListRequest, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelListRequest or - JSON or IO[bytes] - :return: An iterator like instance of str - :rtype: ~azure.core.async_paging.AsyncItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[str]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_groups_list_delta_models_async_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[str], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _modify_delta_models_async_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelModifyRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_modify_delta_models_async_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.DeltaModelModifyRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelModifyRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelModifyRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Is one of the following types: DeltaModelModifyRequest, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelModifyRequest or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._modify_delta_models_async_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_status( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> _models.GroupStatus: - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :return: GroupStatus. The GroupStatus is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GroupStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.GroupStatus] = kwargs.pop("cls", None) - - _request = build_inference_groups_get_status_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.GroupStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SkuResource"]: - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :keyword count: Number of Skus to be retrieved in a page of results. Default value is None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of SkuResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SkuResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_groups_list_skus_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SkuResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class MarketplaceSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`marketplace_subscriptions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.MarketplaceSubscription: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: MarketplaceSubscription. The MarketplaceSubscription is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.MarketplaceSubscription] = kwargs.pop("cls", None) - - _request = build_marketplace_subscriptions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.MarketplaceSubscription, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.MarketplaceSubscription, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_marketplace_subscriptions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.MarketplaceSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.MarketplaceSubscription, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Is one of the following - types: MarketplaceSubscription, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MarketplaceSubscription] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.MarketplaceSubscription, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.MarketplaceSubscription].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.MarketplaceSubscription]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_marketplace_subscriptions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.MarketplaceSubscription"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of MarketplaceSubscription - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.MarketplaceSubscription]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_marketplace_subscriptions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.MarketplaceSubscription], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class OnlineEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`online_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.OnlineEndpoint: - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: OnlineEndpoint. The OnlineEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OnlineEndpoint] = kwargs.pop("cls", None) - - _request = build_online_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OnlineEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.OnlineEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.OnlineEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.OnlineEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - OnlineEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OnlineEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OnlineEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.PartialMinimalTrackedResourceWithIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OnlineEndpoint. The OnlineEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OnlineEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OnlineEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_online_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, _models.EndpointComputeType]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.OnlineEndpoint"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword name: Name of the endpoint. Default value is None. - :paramtype name: str - :keyword count: Number of endpoints to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword compute_type: EndpointComputeType to be filtered by. Known values are: "Managed", - "Kubernetes", and "AzureMLCompute". Default value is None. - :paramtype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointComputeType - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of OnlineEndpoint - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OnlineEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_online_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OnlineEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointAuthKeys: - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: EndpointAuthKeys. The EndpointAuthKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - - _request = build_online_endpoints_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_endpoints_regenerate_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.RegenerateEndpointKeysRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Is one of the following types: - RegenerateEndpointKeysRequest, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_token( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointAuthToken: - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: EndpointAuthToken. The EndpointAuthToken is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthToken - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthToken] = kwargs.pop("cls", None) - - _request = build_online_endpoints_get_token_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthToken, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class OnlineDeploymentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`online_deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> _models.OnlineDeployment: - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :return: OnlineDeployment. The OnlineDeployment is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OnlineDeployment] = kwargs.pop("cls", None) - - _request = build_online_deployments_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OnlineDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.OnlineDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_deployments_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.OnlineDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.OnlineDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Is one of the following - types: OnlineDeployment, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineDeployment] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OnlineDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OnlineDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_deployments_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.PartialMinimalTrackedResourceWithSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithSku, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineDeployment] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OnlineDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OnlineDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_online_deployments_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.OnlineDeployment"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Top of list. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of OnlineDeployment - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OnlineDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_online_deployments_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OnlineDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.DeploymentLogsRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.DeploymentLogsRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Is one of the following - types: DeploymentLogsRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogsRequest or - JSON or IO[bytes] - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeploymentLogs] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_deployments_get_logs_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeploymentLogs, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SkuResource"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :keyword count: Number of Skus to be retrieved in a page of results. Default value is None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of SkuResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SkuResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_online_deployments_list_skus_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - count=count, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SkuResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class SchedulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`schedules` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.Schedule: - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :return: Schedule. The Schedule is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) - - _request = build_schedules_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Schedule, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.Schedule, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_schedules_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.Schedule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.Schedule, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Is one of the following types: Schedule, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Schedule, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Schedule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Schedule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_schedules_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Union[str, _models.ScheduleListViewType] = "EnabledOnly", - **kwargs: Any - ) -> AsyncItemPaged["_models.Schedule"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: Status filter for schedule. Known values are: "EnabledOnly", - "DisabledOnly", and "All". Default value is "EnabledOnly". - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleListViewType - :return: An iterator like instance of Schedule - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Schedule]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_schedules_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Schedule], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ServerlessEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`serverless_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.ServerlessEndpoint: - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :return: ServerlessEndpoint. The ServerlessEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ServerlessEndpoint] = kwargs.pop("cls", None) - - _request = build_serverless_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ServerlessEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ServerlessEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_serverless_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.ServerlessEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ServerlessEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Is one of the following - types: ServerlessEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerlessEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ServerlessEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ServerlessEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerlessEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_serverless_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.PartialMinimalTrackedResourceWithSkuAndIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Is one of the following - types: PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns ServerlessEndpoint. The ServerlessEndpoint - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerlessEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ServerlessEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ServerlessEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerlessEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_serverless_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerlessEndpoint"]: - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ServerlessEndpoint - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ServerlessEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_serverless_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ServerlessEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.EndpointAuthKeys: - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :return: EndpointAuthKeys. The EndpointAuthKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - - _request = build_serverless_endpoints_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_serverless_endpoints_regenerate_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.RegenerateEndpointKeysRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Is one of the following types: - RegenerateEndpointKeysRequest, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EndpointAuthKeys].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EndpointAuthKeys]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class RaiPolicyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`rai_policy` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, rai_policy_name: str, **kwargs: Any - ) -> _models.RaiPolicyPropertiesBasicResource: - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :return: RaiPolicyPropertiesBasicResource. The RaiPolicyPropertiesBasicResource is compatible - with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_rai_policy_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_rai_policy_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - proxy_api_version=proxy_api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: _models.RaiPolicyPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Is one of the following types: RaiPolicyPropertiesBasicResource, JSON, IO[bytes] - Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource or - JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_rai_policy_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - proxy_api_version=proxy_api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Is one of the following types: - PrivateEndpointConnection, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - or JSON or IO[bytes] - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_private_endpoint_connections_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> None: - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PrivateEndpointConnection"]: - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of PrivateEndpointConnection - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_private_endpoint_connections_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PrivateEndpointConnection], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ComputeOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`compute` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> _models.ComputeResource: - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: ComputeResource. The ComputeResource is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComputeResource] = kwargs.pop("cls", None) - - _request = build_compute_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComputeResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ComputeResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.ComputeResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ComputeResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Is one of the following - types: ComputeResource, JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComputeResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ComputeResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ComputeResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ComputeResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ClusterUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.ClusterUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Required. - :type parameters: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClusterUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ClusterUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Is one of the following types: - ClusterUpdateParameters, JSON, IO[bytes] Required. - :type parameters: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClusterUpdateParameters or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComputeResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = _deserialize(_models.ComputeResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ComputeResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ComputeResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - *, - underlying_resource_action: Union[str, _models.UnderlyingResourceAction], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - underlying_resource_action=underlying_resource_action, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - *, - underlying_resource_action: Union[str, _models.UnderlyingResourceAction], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :keyword underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. Known values are: "Delete" and "Detach". - Required. - :paramtype underlying_resource_action: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UnderlyingResourceAction - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ComputeResource"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ComputeResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComputeResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_compute_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComputeResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def update_custom_services( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List[_models.CustomService], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Required. - :type custom_services: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CustomService] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_custom_services( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List[JSON], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Required. - :type custom_services: list[JSON] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_custom_services( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Required. - :type custom_services: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update_custom_services( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: Union[List[_models.CustomService], List[JSON], IO[bytes]], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Is one of the following types: - [CustomService], [JSON], IO[bytes] Required. - :type custom_services: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CustomService] or list[JSON] or - IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(custom_services, (IOBase, bytes)): - _content = custom_services - else: - _content = json.dumps(custom_services, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_custom_services_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_nodes( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.AmlComputeNodeInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An iterator like instance of AmlComputeNodeInformation - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AmlComputeNodeInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AmlComputeNodeInformation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_compute_list_nodes_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AmlComputeNodeInformation], - deserialized.get("nodes", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> _models.ComputeSecrets: - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: ComputeSecrets. The ComputeSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComputeSecrets] = kwargs.pop("cls", None) - - _request = build_compute_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComputeSecrets, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update_data_mounts( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List[_models.ComputeInstanceDataMount], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - Required. - :type data_mounts: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceDataMount] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_data_mounts( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List[JSON], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - Required. - :type data_mounts: list[JSON] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_data_mounts( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - Required. - :type data_mounts: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update_data_mounts( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: Union[List[_models.ComputeInstanceDataMount], List[JSON], IO[bytes]], - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. Is - one of the following types: [ComputeInstanceDataMount], [JSON], IO[bytes] Required. - :type data_mounts: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceDataMount] or - list[JSON] or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(data_mounts, (IOBase, bytes)): - _content = data_mounts - else: - _content = json.dumps(data_mounts, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_data_mounts_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - async def _start_initial( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_start_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_start( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _stop_initial( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_stop_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_stop( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _restart_initial( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_restart_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_restart( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - async def update_idle_shutdown_setting( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.IdleShutdownSetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdleShutdownSetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_idle_shutdown_setting( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_idle_shutdown_setting( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update_idle_shutdown_setting( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.IdleShutdownSetting, JSON, IO[bytes]], - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Is one of the following types: IdleShutdownSetting, JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdleShutdownSetting - or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_idle_shutdown_setting_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get_allowed_resize_sizes( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> _models.VirtualMachineSizeListResult: - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: VirtualMachineSizeListResult. The VirtualMachineSizeListResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSizeListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.VirtualMachineSizeListResult] = kwargs.pop("cls", None) - - _request = build_compute_get_allowed_resize_sizes_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VirtualMachineSizeListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _resize_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ResizeSchema, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_resize_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.ResizeSchema, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResizeSchema - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ResizeSchema, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. Is - one of the following types: ResizeSchema, JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResizeSchema or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class WorkspaceFeaturesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`workspace_features` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.AmlUserFeature"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of AmlUserFeature - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AmlUserFeature] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AmlUserFeature]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspace_features_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AmlUserFeature], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ConnectionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`connection` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get_all_models( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.EndpointModels: - """Get all models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: EndpointModels. The EndpointModels is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModels - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointModels] = kwargs.pop("cls", None) - - _request = build_connection_get_all_models_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointModels, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EndpointModelProperties"]: - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of EndpointModelProperties - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointModelProperties]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_get_models_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointModelProperties], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_deployment( - self, resource_group_name: str, workspace_name: str, connection_name: str, deployment_name: str, **kwargs: Any - ) -> _models.EndpointDeploymentResourcePropertiesBasicResource: - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :return: EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_get_deployment_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_deployment_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_create_or_update_deployment_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: _models.EndpointDeploymentResourcePropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Is one of the following types: - EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - or JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_deployment_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_delete_deployment_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_deployments( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of EndpointDeploymentResourcePropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointDeploymentResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_list_deployments_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointDeploymentResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`private_link_resources` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PrivateLinkResource"]: - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, - etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, - etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of PrivateLinkResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateLinkResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_private_link_resources_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PrivateLinkResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ManagedNetworkProvisionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`managed_network_provisions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.ManagedNetworkProvisionOptions, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_managed_network_provisions_provision_managed_network_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[_models.ManagedNetworkProvisionOptions] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Default - value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionOptions - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Default - value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Default - value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.ManagedNetworkProvisionOptions, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Is one of - the following types: ManagedNetworkProvisionOptions, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionOptions or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.ManagedNetworkProvisionStatus] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedNetworkProvisionStatus, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ManagedNetworkProvisionStatus].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedNetworkProvisionStatus]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class RegistryCodeContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_code_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any - ) -> _models.CodeContainer: - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - - _request = build_registry_code_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: Union[_models.CodeContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_code_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: _models.CodeContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CodeContainer. The CodeContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CodeContainer. The CodeContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CodeContainer. The CodeContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: Union[_models.CodeContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Is one of the following types: - CodeContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns CodeContainer. The CodeContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CodeContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CodeContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CodeContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_code_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.CodeContainer"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of CodeContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_code_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistryDataReferencesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_data_references` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: _models.GetBlobReferenceSASRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.GetBlobReferenceSASRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Is one of the following types: - GetBlobReferenceSASRequestDto, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASRequestDto or JSON - or IO[bytes] - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GetBlobReferenceSASResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_references_get_blob_reference_sas_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.GetBlobReferenceSASResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RegistryCodeVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_code_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any - ) -> _models.CodeVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - - _request = build_registry_code_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: Union[_models.CodeVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_code_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: _models.CodeVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CodeVersion. The CodeVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CodeVersion. The CodeVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns CodeVersion. The CodeVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: Union[_models.CodeVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: CodeVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns CodeVersion. The CodeVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CodeVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CodeVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CodeVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_code_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.CodeVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of CodeVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_code_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_code_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RegistryComponentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_component_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any - ) -> _models.ComponentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - - _request = build_registry_component_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: Union[_models.ComponentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_component_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: _models.ComponentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComponentContainer. The ComponentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComponentContainer. The ComponentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComponentContainer. The ComponentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: Union[_models.ComponentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Is one of the following types: - ComponentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns ComponentContainer. The ComponentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ComponentContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ComponentContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ComponentContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_component_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ComponentContainer"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ComponentContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_component_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistryComponentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_component_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any - ) -> _models.ComponentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - - _request = build_registry_component_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: Union[_models.ComponentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_component_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: _models.ComponentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: Union[_models.ComponentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - ComponentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ComponentVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ComponentVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ComponentVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_component_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ComponentVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ComponentVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_component_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistryDataContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_data_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any - ) -> _models.DataContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - - _request = build_registry_data_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: Union[_models.DataContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: _models.DataContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DataContainer. The DataContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DataContainer. The DataContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DataContainer. The DataContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: Union[_models.DataContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - DataContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns DataContainer. The DataContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DataContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DataContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DataContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_data_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DataContainer"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_data_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistryDataVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_data_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any - ) -> _models.DataVersionBase: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - - _request = build_registry_data_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataVersionBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.DataVersionBase, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: _models.DataVersionBase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.DataVersionBase, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - DataVersionBase, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DataVersionBase, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DataVersionBase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DataVersionBase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_data_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DataVersionBase"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :keyword order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. Default - value is None. - :paramtype order_by: str - :keyword top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count will be returned. Default - value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataVersionBase - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataVersionBase]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_data_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataVersionBase], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RegistryEnvironmentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_environment_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any - ) -> _models.EnvironmentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - - _request = build_registry_environment_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: Union[_models.EnvironmentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_environment_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: _models.EnvironmentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EnvironmentContainer. The - EnvironmentContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EnvironmentContainer. The - EnvironmentContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EnvironmentContainer. The - EnvironmentContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: Union[_models.EnvironmentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Is one of the following types: - EnvironmentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns EnvironmentContainer. The - EnvironmentContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EnvironmentContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EnvironmentContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_environment_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EnvironmentContainer"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_environment_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistryEnvironmentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_environment_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any - ) -> _models.EnvironmentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - - _request = build_registry_environment_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: Union[_models.EnvironmentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_environment_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: _models.EnvironmentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EnvironmentVersion. The EnvironmentVersion - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EnvironmentVersion. The EnvironmentVersion - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EnvironmentVersion. The EnvironmentVersion - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: Union[_models.EnvironmentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - EnvironmentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion or JSON - or IO[bytes] - :return: An instance of AsyncLROPoller that returns EnvironmentVersion. The EnvironmentVersion - is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EnvironmentVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EnvironmentVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_environment_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EnvironmentVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_environment_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistryModelContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_model_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any - ) -> _models.ModelContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - - _request = build_registry_model_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: Union[_models.ModelContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_model_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: _models.ModelContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ModelContainer. The ModelContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ModelContainer. The ModelContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ModelContainer. The ModelContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: Union[_models.ModelContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Is one of the following types: - ModelContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns ModelContainer. The ModelContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ModelContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ModelContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ModelContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_model_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ModelContainer"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelContainer - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_model_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RegistryModelVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`registry_model_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any - ) -> _models.ModelVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - - _request = build_registry_model_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: Union[_models.ModelVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_model_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: _models.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ModelVersion. The ModelVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ModelVersion. The ModelVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ModelVersion. The ModelVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: Union[_models.ModelVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns ModelVersion. The ModelVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ModelVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ModelVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ModelVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_model_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - *, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ModelVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword version: Version identifier. Default value is None. - :paramtype version: str - :keyword description: Model description. Default value is None. - :paramtype description: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. Default value is None. - :paramtype properties: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_model_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_model_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`jobs` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any) -> _models.JobBase: - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.JobBase] = kwargs.pop("cls", None) - - _request = build_jobs_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.JobBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: _models.JobBase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: Union[_models.JobBase, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Is one of the following types: JobBase, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase or JSON or - IO[bytes] - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobBase] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_jobs_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.JobBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_jobs_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - properties: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobBase"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword job_type: Type of job to be returned. Default value is None. - :paramtype job_type: str - :keyword tag: Jobs returned will have this tag key. Default value is None. - :paramtype tag: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword properties: Comma-separated list of user property names (and optionally values). - Example: prop1,prop2=value2. Default value is None. - :paramtype properties: str - :return: An iterator like instance of JobBase - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.JobBase]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_jobs_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.JobBase], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _cancel_initial( - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_jobs_cancel_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_cancel( - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class WorkspaceConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`workspace_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - _request = build_workspace_connections_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[_models.WorkspaceConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Default value is - None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Default value is - None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Default value is - None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Is one of the - following types: WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes] Default value is - None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - or JSON or IO[bytes] - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspace_connections_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[_models.WorkspaceConnectionUpdateParameter] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionUpdateParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionUpdateParameter, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Is one of the following types: - WorkspaceConnectionUpdateParameter, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionUpdateParameter or - JSON or IO[bytes] - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspace_connections_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any) -> None: - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_workspace_connections_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: bool = False, - **kwargs: Any - ) -> AsyncItemPaged["_models.WorkspaceConnectionPropertiesV2BasicResource"]: - """List all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword target: Target of the workspace connection. Default value is None. - :paramtype target: str - :keyword category: Category of the workspace connection. Default value is None. - :paramtype category: str - :keyword include_all: query parameter that indicates if get connection call should return both - connections and datastores. Default value is False. - :paramtype include_all: bool - :return: An iterator like instance of WorkspaceConnectionPropertiesV2BasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.WorkspaceConnectionPropertiesV2BasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspace_connections_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - target=target, - category=category, - include_all=include_all, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.WorkspaceConnectionPropertiesV2BasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def list_secrets( - self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - _request = build_workspace_connections_list_secrets_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _test_connection_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspace_connections_test_connection_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[_models.WorkspaceConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Is one of the following types: - WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiBlocklistOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklist` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> _models.RaiBlocklistPropertiesBasicResource: - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :return: RaiBlocklistPropertiesBasicResource. The RaiBlocklistPropertiesBasicResource is - compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiBlocklistPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBlocklistPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[_models.RaiBlocklistPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: _models.RaiBlocklistPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[_models.RaiBlocklistPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Is one of the following types: RaiBlocklistPropertiesBasicResource, JSON, - IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource or - JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiBlocklistPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiBlocklistPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.RaiBlocklistPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RaiBlocklistPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiBlocklistsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklists` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.RaiBlocklistPropertiesBasicResource"]: - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiBlocklistPropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiBlocklistPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_rai_blocklists_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiBlocklistPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ConnectionRaiBlocklistItemOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklist_item` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _add_bulk_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[_models.RaiBlocklistItemBulkRequest], List[JSON], IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_item_add_bulk_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List[_models.RaiBlocklistItemBulkRequest], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Required. - :type body: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemBulkRequest] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns list of - RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List[JSON], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Required. - :type body: list[JSON] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns list of - RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns list of - RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[_models.RaiBlocklistItemBulkRequest], List[JSON], IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Is one of the following types: - [RaiBlocklistItemBulkRequest], [JSON], IO[bytes] Required. - :type body: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemBulkRequest] or - list[JSON] or IO[bytes] - :return: An instance of AsyncLROPoller that returns list of - RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[_models.RaiBlocklistItemPropertiesBasicResource]] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._add_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = _deserialize(List[_models.RaiBlocklistItemPropertiesBasicResource], response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_bulk_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[str], IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_item_delete_bulk_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_delete_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List[str], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. Required. - :type body: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_delete_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_delete_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[str], IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. Is either a [str] type or a IO[bytes] type. - Required. - :type body: list[str] or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> _models.RaiBlocklistItemPropertiesBasicResource: - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :return: RaiBlocklistItemPropertiesBasicResource. The RaiBlocklistItemPropertiesBasicResource - is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiBlocklistItemPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_item_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBlocklistItemPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: Union[_models.RaiBlocklistItemPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_item_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: _models.RaiBlocklistItemPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistItemPropertiesBasicResource. - The RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistItemPropertiesBasicResource. - The RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistItemPropertiesBasicResource. - The RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: Union[_models.RaiBlocklistItemPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Is one of the following types: RaiBlocklistItemPropertiesBasicResource, JSON, - IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource - or JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns RaiBlocklistItemPropertiesBasicResource. - The RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiBlocklistItemPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiBlocklistItemPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.RaiBlocklistItemPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RaiBlocklistItemPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_item_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiBlocklistItemsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklist_items` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.RaiBlocklistItemPropertiesBasicResource"]: - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiBlocklistItemPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_rai_blocklist_items_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiBlocklistItemPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ConnectionRaiPolicyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_policy` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, connection_name: str, rai_policy_name: str, **kwargs: Any - ) -> _models.RaiPolicyPropertiesBasicResource: - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :return: RaiPolicyPropertiesBasicResource. The RaiPolicyPropertiesBasicResource is compatible - with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_rai_policy_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_policy_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: _models.RaiPolicyPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Is one of the following types: RaiPolicyPropertiesBasicResource, JSON, IO[bytes] - Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource or - JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RaiPolicyPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_rai_policy_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.RaiPolicyPropertiesBasicResource"]: - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiPolicyPropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiPolicyPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_rai_policies_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiPolicyPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class RaiPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`rai_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.RaiPolicyPropertiesBasicResource"]: - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiPolicyPropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiPolicyPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_policies_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiPolicyPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class EndpointOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`endpoint` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointResourcePropertiesBasicResource: - """Get endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: EndpointResourcePropertiesBasicResource. The EndpointResourcePropertiesBasicResource - is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointResourcePropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_endpoint_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointResourcePropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.EndpointResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_endpoint_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.EndpointResourcePropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EndpointResourcePropertiesBasicResource. - The EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EndpointResourcePropertiesBasicResource. - The EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EndpointResourcePropertiesBasicResource. - The EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.EndpointResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Is one of the following types: - EndpointResourcePropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns EndpointResourcePropertiesBasicResource. - The EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointResourcePropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointResourcePropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EndpointResourcePropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EndpointResourcePropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - endpoint_type: Optional[Union[str, _models.EndpointType]] = None, - include_online_endpoints: bool = False, - include_serverless_endpoints: bool = False, - include_connections: bool = False, - skip: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EndpointResourcePropertiesBasicResource"]: - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword endpoint_type: Endpoint type filter. Known values are: "Azure.OpenAI", "Azure.Speech", - "Azure.ContentSafety", "Azure.Llama", "managedOnlineEndpoint", and "serverlessEndpoint". - Default value is None. - :paramtype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointType - :keyword include_online_endpoints: Default value is False. - :paramtype include_online_endpoints: bool - :keyword include_serverless_endpoints: Default value is False. - :paramtype include_serverless_endpoints: bool - :keyword include_connections: Default value is False. - :paramtype include_connections: bool - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword expand: Whether the endpoint resource will be expand to include deployment - information, e.g. $expand=deployments. Default value is None. - :paramtype expand: str - :return: An iterator like instance of EndpointResourcePropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - endpoint_type=endpoint_type, - include_online_endpoints=include_online_endpoints, - include_serverless_endpoints=include_serverless_endpoints, - include_connections=include_connections, - skip=skip, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointKeys: - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: EndpointKeys. The EndpointKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointKeys] = kwargs.pop("cls", None) - - _request = build_endpoint_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_models( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.EndpointModelProperties"]: - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: An iterator like instance of EndpointModelProperties - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointModelProperties]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_get_models_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointModelProperties], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.RegenerateServiceAccountKeyContent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateServiceAccountKeyContent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.RegenerateServiceAccountKeyContent, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Is one of the following types: RegenerateServiceAccountKeyContent, JSON, IO[bytes] - Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateServiceAccountKeyContent or - JSON or IO[bytes] - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccountApiKeys] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_endpoint_regenerate_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AccountApiKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ManagedNetworkSettingsRuleOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`managed_network_settings_rule` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, rule_name: str, **kwargs: Any - ) -> _models.OutboundRuleBasicResource: - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: OutboundRuleBasicResource. The OutboundRuleBasicResource is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - - _request = build_managed_network_settings_rule_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_managed_network_settings_rule_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: _models.OutboundRuleBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Is one of the following types: OutboundRuleBasicResource, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OutboundRuleBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OutboundRuleBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, rule_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_managed_network_settings_rule_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.OutboundRuleBasicResource"]: - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of OutboundRuleBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OutboundRuleBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_managed_network_settings_rule_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OutboundRuleBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class OutboundRuleOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`outbound_rule` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, rule_name: str, **kwargs: Any - ) -> _models.OutboundRuleBasicResource: - """The GET API for retrieveing a single outbound rule of the managed network associated with the - machine learning workspace. - - The GET API for retrieveing a single outbound rule of the managed network associated with the - machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: OutboundRuleBasicResource. The OutboundRuleBasicResource is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - - _request = build_outbound_rule_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_outbound_rule_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: _models.OutboundRuleBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Is one of the following types: OutboundRuleBasicResource, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OutboundRuleBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OutboundRuleBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, rule_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_outbound_rule_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """The DELETE API for deleting a single outbound rule of the managed network associated with the - machine learning workspace. - - The DELETE API for deleting a single outbound rule of the managed network associated with the - machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.OutboundRuleBasicResource"]: - """The GET API for retrieveing the list of outbound rules of the managed network associated with - the machine learning workspace. - - The GET API for retrieveing the list of outbound rules of the managed network associated with - the machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :return: An iterator like instance of OutboundRuleBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OutboundRuleBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_outbound_rule_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OutboundRuleBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ManagedNetworkSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`managed_network_settings` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, **kwargs: Any - ) -> _models.ManagedNetworkSettingsPropertiesBasicResource: - """Get the managed network settings for a machine learning workspace. - - Get API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :return: ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ManagedNetworkSettingsPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_managed_network_settings_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ManagedNetworkSettingsPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _put_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_managed_network_settings_put_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: _models.ManagedNetworkSettingsPropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Is one of the following - types: ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedNetworkSettingsPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._put_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedNetworkSettingsPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _patch_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_managed_network_settings_patch_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[_models.ManagedNetworkSettingsPropertiesBasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Is one of the following - types: ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns - ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.ManagedNetworkSettingsPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._patch_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedNetworkSettingsPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedNetworkSettingsPropertiesBasicResource"]: - """List the managed network settings for a machine learning workspace. - - List API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of ManagedNetworkSettingsPropertiesBasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ManagedNetworkSettingsPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_managed_network_settings_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ManagedNetworkSettingsPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class OutboundRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`outbound_rules` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _post_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_outbound_rules_post_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: _models.ManagedNetworkSettingsBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[AsyncItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[AsyncItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[AsyncItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[AsyncItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Is one of the following - types: ManagedNetworkSettingsBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsBasicResource or - JSON or IO[bytes] - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[_models.OutboundRuleBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(next_link=None): - if not next_link: - - _request = build_outbound_rules_post_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OutboundRuleBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._post_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - async def internal_get_next(next_link=None): - if next_link is None: - return pipeline_response - return await get_next(next_link) - - return AsyncItemPaged(internal_get_next, extract_data) - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[AsyncItemPaged["_models.OutboundRuleBasicResource"]].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[AsyncItemPaged["_models.OutboundRuleBasicResource"]]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class UsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`usages` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.Usage"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location name. Required. - :type location: str - :return: An iterator like instance of Usage - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Usage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Usage]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_usages_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Usage], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class VirtualMachineSizesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`virtual_machine_sizes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list(self, location: str, **kwargs: Any) -> _models.VirtualMachineSizeListResult: - """Returns supported VM Sizes in a location. - - :param location: The location name. Required. - :type location: str - :return: VirtualMachineSizeListResult. The VirtualMachineSizeListResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSizeListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.VirtualMachineSizeListResult] = kwargs.pop("cls", None) - - _request = build_virtual_machine_sizes_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VirtualMachineSizeListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class QuotasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`quotas` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def update( - self, - location: str, - parameters: _models.QuotaUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, location: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, location: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, location: str, parameters: Union[_models.QuotaUpdateParameters, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Is one of the following types: QuotaUpdateParameters, - JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaUpdateParameters - or JSON or IO[bytes] - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateWorkspaceQuotasResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_quotas_update_request( - location=location, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.UpdateWorkspaceQuotasResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.ResourceQuota"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location name. Required. - :type location: str - :return: An iterator like instance of ResourceQuota - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResourceQuota] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ResourceQuota]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_quotas_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ResourceQuota], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class PTUQuotaOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.aio.MachineLearningServicesMgmtClient`'s - :attr:`ptu_quota` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_available( - self, location: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.AvailableQuota"]: - """List available MaaS PTU quota. - - List available MaaS PTU quota. - - :param location: The location name. Required. - :type location: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of AvailableQuota - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AvailableQuota] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AvailableQuota]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_ptu_quota_list_available_request( - location=location, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AvailableQuota], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_available(self, location: str, **kwargs: Any) -> _models.AvailableQuota: - """Get available MaaS PTU quota. - - Get available MaaS PTU quota. - - :param location: The location name. Required. - :type location: str - :return: AvailableQuota. The AvailableQuota is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AvailableQuota - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AvailableQuota] = kwargs.pop("cls", None) - - _request = build_ptu_quota_get_available_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AvailableQuota, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, location: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.UsageAndQuotaDetails"]: - """List MaaS PTU usage and quota. - - List MaaS PTU usage and quota. - - :param location: The location name. Required. - :type location: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of UsageAndQuotaDetails - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UsageAndQuotaDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.UsageAndQuotaDetails]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_ptu_quota_list_request( - location=location, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.UsageAndQuotaDetails], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_patch.py deleted file mode 100644 index ea765788358a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/__init__.py deleted file mode 100644 index 2af98e34df4d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/__init__.py +++ /dev/null @@ -1,1567 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - AADAuthTypeWorkspaceConnectionProperties, - AKS, - AKSSchemaProperties, - AccessKeyAuthTypeWorkspaceConnectionProperties, - AccountApiKeys, - AccountKeyAuthTypeWorkspaceConnectionProperties, - AccountKeyDatastoreCredentials, - AccountKeyDatastoreSecrets, - AcrDetails, - ActualCapacityInfo, - AksComputeSecrets, - AksNetworkingConfiguration, - AllFeatures, - AllNodes, - AmlCompute, - AmlComputeNodeInformation, - AmlComputeProperties, - AmlToken, - AmlTokenComputeIdentity, - AmlUserFeature, - AnonymousAccessCredential, - ApiKeyAuthWorkspaceConnectionProperties, - ArmResourceId, - AssetBase, - AssetContainer, - AssetReferenceBase, - AssignedUser, - AutoForecastHorizon, - AutoMLJob, - AutoMLVertical, - AutoNCrossValidations, - AutoPauseProperties, - AutoScaleProperties, - AutoSeasonality, - AutoTargetLags, - AutoTargetRollingWindowSize, - AvailableQuota, - AvailableQuotaProperties, - AzureBlobDatastore, - AzureDataLakeGen1Datastore, - AzureDataLakeGen2Datastore, - AzureDevOpsWebhook, - AzureFileDatastore, - AzureOpenAiFineTuning, - AzureOpenAiHyperParameters, - BanditPolicy, - BatchDeployment, - BatchDeploymentConfiguration, - BatchDeploymentProperties, - BatchEndpoint, - BatchEndpointDefaults, - BatchEndpointProperties, - BatchPipelineComponentDeploymentConfiguration, - BatchRetrySettings, - BayesianSamplingAlgorithm, - BindOptions, - BlobReferenceForConsumptionDto, - BuildContext, - CapabilityHost, - CapabilityHostProperties, - CategoricalDataDriftMetricThreshold, - CategoricalDataQualityMetricThreshold, - CategoricalPredictionDriftMetricThreshold, - CertificateDatastoreCredentials, - CertificateDatastoreSecrets, - Classification, - ClassificationTrainingSettings, - ClusterUpdateParameters, - ClusterUpdateProperties, - CodeConfiguration, - CodeContainer, - CodeContainerProperties, - CodeVersion, - CodeVersionProperties, - CognitiveServicesSku, - Collection, - ColumnTransformer, - CommandJob, - CommandJobLimits, - ComponentContainer, - ComponentContainerProperties, - ComponentVersion, - ComponentVersionProperties, - Compute, - ComputeInstance, - ComputeInstanceApplication, - ComputeInstanceAutologgerSettings, - ComputeInstanceConnectivityEndpoints, - ComputeInstanceContainer, - ComputeInstanceCreatedBy, - ComputeInstanceDataDisk, - ComputeInstanceDataMount, - ComputeInstanceEnvironmentInfo, - ComputeInstanceLastOperation, - ComputeInstanceProperties, - ComputeInstanceSshSettings, - ComputeInstanceVersion, - ComputeRecurrenceSchedule, - ComputeResource, - ComputeRuntimeDto, - ComputeSchedules, - ComputeSecrets, - ComputeStartStopSchedule, - ContainerResourceRequirements, - ContainerResourceSettings, - ContentSafety, - ContentSafetyEndpointDeploymentResourceProperties, - ContentSafetyEndpointResourceProperties, - CosmosDbSettings, - CreateMonitorAction, - Cron, - CronTrigger, - CustomForecastHorizon, - CustomKeys, - CustomKeysWorkspaceConnectionProperties, - CustomMetricThreshold, - CustomModelFineTuning, - CustomModelJobInput, - CustomModelJobOutput, - CustomMonitoringSignal, - CustomNCrossValidations, - CustomSeasonality, - CustomService, - CustomTargetLags, - CustomTargetRollingWindowSize, - DataCollector, - DataContainer, - DataContainerProperties, - DataDriftMetricThresholdBase, - DataDriftMonitoringSignal, - DataFactory, - DataGenerationVertical, - DataLakeAnalytics, - DataLakeAnalyticsSchemaProperties, - DataPathAssetReference, - DataQualityMetricThresholdBase, - DataQualityMonitoringSignal, - DataReferenceCredential, - DataVersionBase, - DataVersionBaseProperties, - Databricks, - DatabricksComputeSecrets, - DatabricksProperties, - DatasetReference, - Datastore, - DatastoreCredentials, - DatastoreProperties, - DatastoreSecrets, - DefaultScaleSettings, - DeltaModelCurrentState, - DeltaModelListRequest, - DeltaModelModifyRequest, - DeltaModelStatusRequest, - DeltaModelStatusResponse, - DeploymentLogs, - DeploymentLogsRequest, - DeploymentResourceConfiguration, - DestinationAsset, - DiagnoseRequestProperties, - DiagnoseResponseResult, - DiagnoseResponseResultValue, - DiagnoseResult, - DiagnoseWorkspaceParameters, - DistillationJob, - DistributionConfiguration, - Docker, - DockerCredential, - EarlyTerminationPolicy, - EncryptionKeyVaultUpdateProperties, - EncryptionProperty, - EncryptionUpdateProperties, - Endpoint, - EndpointAuthKeys, - EndpointAuthToken, - EndpointDeploymentModel, - EndpointDeploymentPropertiesBase, - EndpointDeploymentResourceProperties, - EndpointDeploymentResourcePropertiesBasicResource, - EndpointKeys, - EndpointModelDeprecationProperties, - EndpointModelProperties, - EndpointModelSkuCapacityProperties, - EndpointModelSkuProperties, - EndpointModelSkuRateLimitProperties, - EndpointModelSkuRateLimitRulePatternProperties, - EndpointModelSkuRateLimitRuleProperties, - EndpointModels, - EndpointPropertiesBase, - EndpointResourceProperties, - EndpointResourcePropertiesBasicResource, - EndpointScheduleAction, - EnvironmentContainer, - EnvironmentContainerProperties, - EnvironmentVariable, - EnvironmentVersion, - EnvironmentVersionProperties, - ErrorAdditionalInfo, - ErrorDetail, - ErrorResponse, - EstimatedVMPrice, - EstimatedVMPrices, - ExternalFQDNResponse, - FQDNEndpoint, - FQDNEndpointDetail, - FQDNEndpoints, - FQDNEndpointsPropertyBag, - Feature, - FeatureAttributionDriftMonitoringSignal, - FeatureAttributionMetricThreshold, - FeatureImportanceSettings, - FeatureProperties, - FeatureStoreSettings, - FeatureSubset, - FeatureWindow, - FeaturesetContainer, - FeaturesetContainerProperties, - FeaturesetSpecification, - FeaturesetVersion, - FeaturesetVersionBackfillRequest, - FeaturesetVersionBackfillResponse, - FeaturesetVersionProperties, - FeaturestoreEntityContainer, - FeaturestoreEntityContainerProperties, - FeaturestoreEntityVersion, - FeaturestoreEntityVersionProperties, - FeaturizationSettings, - FineTuningJob, - FineTuningVertical, - FinetuningDetails, - FixedInputData, - FlavorData, - ForecastHorizon, - Forecasting, - ForecastingSettings, - ForecastingTrainingSettings, - FqdnOutboundRule, - GetBlobReferenceForConsumptionDto, - GetBlobReferenceSASRequestDto, - GetBlobReferenceSASResponseDto, - GridSamplingAlgorithm, - GroupEnvironmentConfiguration, - GroupModelConfiguration, - GroupStatus, - HDInsight, - HDInsightProperties, - IPRule, - IdAssetReference, - IdentityConfiguration, - IdentityForCmk, - IdleShutdownSetting, - Image, - ImageClassification, - ImageClassificationMultilabel, - ImageDetails, - ImageInfo, - ImageInstanceSegmentation, - ImageLimitSettings, - ImageMetadata, - ImageModelDistributionSettings, - ImageModelDistributionSettingsClassification, - ImageModelDistributionSettingsObjectDetection, - ImageModelSettings, - ImageModelSettingsClassification, - ImageModelSettingsObjectDetection, - ImageObjectDetection, - ImageSweepSettings, - IndexColumn, - InferenceContainerProperties, - InferenceEndpoint, - InferenceEndpointProperties, - InferenceGroup, - InferenceGroupProperties, - InferencePool, - InferencePoolProperties, - InstanceTypeSchema, - InstanceTypeSchemaResources, - JobBase, - JobBaseProperties, - JobInput, - JobLimits, - JobOutput, - JobResourceConfiguration, - JobResources, - JobScheduleAction, - JobService, - JupyterKernelConfig, - KeyVaultProperties, - Kubernetes, - KubernetesOnlineDeployment, - KubernetesProperties, - LabelGeneration, - LakeHouseArtifact, - ListNotebookKeysResult, - ListStorageAccountKeysResult, - ListWorkspaceKeysResult, - LiteralJobInput, - MLFlowModelJobInput, - MLFlowModelJobOutput, - MLTableData, - MLTableJobInput, - MLTableJobOutput, - ManagedComputeIdentity, - ManagedIdentity, - ManagedIdentityAuthTypeWorkspaceConnectionProperties, - ManagedIdentityCredential, - ManagedNetworkProvisionOptions, - ManagedNetworkProvisionStatus, - ManagedNetworkSettings, - ManagedNetworkSettingsBasicResource, - ManagedNetworkSettingsEx, - ManagedNetworkSettingsProperties, - ManagedNetworkSettingsPropertiesBasicResource, - ManagedOnlineDeployment, - ManagedOnlineEndpointDeploymentResourceProperties, - ManagedOnlineEndpointResourceProperties, - ManagedResourceGroupAssignedIdentities, - ManagedResourceGroupSettings, - ManagedServiceIdentity, - MarketplacePlan, - MarketplaceSubscription, - MarketplaceSubscriptionProperties, - MaterializationComputeResource, - MaterializationSettings, - MedianStoppingPolicy, - ModelContainer, - ModelContainerProperties, - ModelSettings, - ModelVersion, - ModelVersionProperties, - MonitorComputeConfigurationBase, - MonitorComputeIdentityBase, - MonitorDefinition, - MonitorEmailNotificationSettings, - MonitorNotificationSettings, - MonitorServerlessSparkCompute, - MonitoringFeatureFilterBase, - MonitoringInputDataBase, - MonitoringSignalBase, - MonitoringTarget, - MonitoringThreshold, - Mpi, - NCrossValidations, - NetworkAcls, - NlpVerticalFeaturizationSettings, - NlpVerticalLimitSettings, - NodeStateCounts, - Nodes, - NoneAuthTypeWorkspaceConnectionProperties, - NoneDatastoreCredentials, - NotebookAccessTokenResult, - NotebookPreparationError, - NotebookResourceInfo, - NotificationSetting, - NumericalDataDriftMetricThreshold, - NumericalDataQualityMetricThreshold, - NumericalPredictionDriftMetricThreshold, - OAuth2AuthTypeWorkspaceConnectionProperties, - Objective, - OneLakeArtifact, - OneLakeDatastore, - OnlineDeployment, - OnlineDeploymentProperties, - OnlineEndpoint, - OnlineEndpointProperties, - OnlineRequestSettings, - OnlineScaleSettings, - OpenAIEndpointDeploymentResourceProperties, - OpenAIEndpointResourceProperties, - Operation, - OperationDisplay, - OsPatchingStatus, - OutboundRule, - OutboundRuleBasicResource, - OutputPathAssetReference, - PATAuthTypeWorkspaceConnectionProperties, - PTUDeploymentUsage, - PackageDetails, - PartialBatchDeployment, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - PartialManagedServiceIdentity, - PartialMinimalTrackedResource, - PartialMinimalTrackedResourceWithIdentity, - PartialMinimalTrackedResourceWithSku, - PartialMinimalTrackedResourceWithSkuAndIdentity, - PartialRegistryPartialTrackedResource, - PartialSku, - Password, - PendingUploadCredentialDto, - PendingUploadRequestDto, - PendingUploadResponseDto, - PersonalComputeInstanceSettings, - PipelineJob, - PredictionDriftMetricThresholdBase, - PredictionDriftMonitoringSignal, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionProperties, - PrivateEndpointDestination, - PrivateEndpointOutboundRule, - PrivateEndpointResource, - PrivateLinkResource, - PrivateLinkResourceProperties, - PrivateLinkServiceConnectionState, - ProbeSettings, - PromptSettings, - PropertiesBase, - ProxyResource, - PyTorch, - QueueSettings, - QuotaBaseProperties, - QuotaUpdateParameters, - RaiBlocklistConfig, - RaiBlocklistItemBulkRequest, - RaiBlocklistItemProperties, - RaiBlocklistItemPropertiesBasicResource, - RaiBlocklistProperties, - RaiBlocklistPropertiesBasicResource, - RaiPolicyContentFilter, - RaiPolicyProperties, - RaiPolicyPropertiesBasicResource, - RandomSamplingAlgorithm, - Recurrence, - RecurrenceSchedule, - RecurrenceTrigger, - RegenerateEndpointKeysRequest, - RegenerateServiceAccountKeyContent, - Registry, - RegistryListCredentialsResult, - RegistryPartialManagedServiceIdentity, - RegistryPrivateEndpointConnection, - RegistryPrivateEndpointConnectionProperties, - RegistryPrivateLinkServiceConnectionState, - RegistryProperties, - RegistryRegionArmDetails, - Regression, - RegressionTrainingSettings, - RequestConfiguration, - RequestLogging, - ResizeSchema, - Resource, - ResourceBase, - ResourceConfiguration, - ResourceId, - ResourceName, - ResourceQuota, - RollingInputData, - Route, - SASAuthTypeWorkspaceConnectionProperties, - SASCredential, - SASCredentialDto, - SamplingAlgorithm, - SasDatastoreCredentials, - SasDatastoreSecrets, - ScaleSettings, - ScaleSettingsInformation, - ScaleUnitConfiguration, - Schedule, - ScheduleActionBase, - ScheduleBase, - ScheduleProperties, - ScriptReference, - ScriptsToExecute, - Seasonality, - SecretExpiry, - ServerlessComputeSettings, - ServerlessEndpoint, - ServerlessEndpointCapacityReservation, - ServerlessEndpointContentSafety, - ServerlessEndpointInferenceEndpoint, - ServerlessEndpointModelSettings, - ServerlessEndpointProperties, - ServerlessEndpointResourceProperties, - ServerlessInferenceEndpoint, - ServerlessOffer, - ServiceManagedResourcesSettings, - ServicePrincipalAuthTypeWorkspaceConnectionProperties, - ServicePrincipalDatastoreCredentials, - ServicePrincipalDatastoreSecrets, - ServiceTagDestination, - ServiceTagOutboundRule, - SetupScripts, - SharedPrivateLinkResource, - SharedPrivateLinkResourceProperty, - Sku, - SkuCapacity, - SkuResource, - SkuSetting, - SparkJob, - SparkJobEntry, - SparkJobPythonEntry, - SparkJobScalaEntry, - SparkResourceConfiguration, - SpeechEndpointDeploymentResourceProperties, - SpeechEndpointResourceProperties, - SslConfiguration, - StackEnsembleSettings, - StaticInputData, - StorageAccountDetails, - StringStringKeyValuePair, - SweepJob, - SweepJobLimits, - SynapseSpark, - SynapseSparkProperties, - SystemCreatedAcrAccount, - SystemCreatedStorageAccount, - SystemData, - SystemService, - TableVerticalFeaturizationSettings, - TableVerticalLimitSettings, - TargetLags, - TargetRollingWindowSize, - TargetUtilizationScaleSettings, - TeacherModelEndpoint, - TeacherModelEndpointRequestSettings, - TeacherModelSettings, - TensorFlow, - TextClassification, - TextClassificationMultilabel, - TextNer, - TmpfsOptions, - TopNFeaturesByAttribution, - TrackedResource, - TrainingSettings, - TrialComponent, - TriggerBase, - TritonModelJobInput, - TritonModelJobOutput, - TruncationSelectionPolicy, - UpdateWorkspaceQuotas, - UpdateWorkspaceQuotasResult, - UriFileDataVersion, - UriFileJobInput, - UriFileJobOutput, - UriFolderDataVersion, - UriFolderJobInput, - UriFolderJobOutput, - Usage, - UsageAndQuotaDetails, - UsageName, - UserAccountCredentials, - UserAssignedIdentity, - UserIdentity, - UsernamePasswordAuthTypeWorkspaceConnectionProperties, - VirtualMachine, - VirtualMachineImage, - VirtualMachineSchemaProperties, - VirtualMachineSecrets, - VirtualMachineSize, - VirtualMachineSizeListResult, - VirtualMachineSshCredentials, - VolumeDefinition, - VolumeOptions, - VulnerabilityDetails, - VulnerabilityFindings, - Webhook, - Workspace, - WorkspaceConnectionAccessKey, - WorkspaceConnectionAccountKey, - WorkspaceConnectionApiKey, - WorkspaceConnectionManagedIdentity, - WorkspaceConnectionOAuth2, - WorkspaceConnectionPersonalAccessToken, - WorkspaceConnectionPropertiesV2, - WorkspaceConnectionPropertiesV2BasicResource, - WorkspaceConnectionServicePrincipal, - WorkspaceConnectionSharedAccessSignature, - WorkspaceConnectionUpdateParameter, - WorkspaceConnectionUsernamePassword, - WorkspaceHubConfig, - WorkspacePrivateEndpointResource, - WorkspaceProperties, - WorkspacePropertiesUpdateParameters, - WorkspaceUpdateParameters, -) - -from ._enums import ( # type: ignore - ActionType, - AllocationState, - AllowedContentLevel, - ApplicationSharingPolicy, - AssetProvisioningState, - AuthMode, - AutoRebuildSetting, - Autosave, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CapabilityHostKind, - CapabilityHostProvisioningState, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstancePropertiesComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeRecurrenceFrequency, - ComputeTriggerType, - ComputeType, - ComputeWeekDay, - ConnectionAuthType, - ConnectionCategory, - ConnectionGroup, - ContainerType, - ContentSafetyLevel, - ContentSafetyStatus, - CreatedByType, - CredentialsType, - DataAvailabilityStatus, - DataCollectionMode, - DataGenerationTaskType, - DataGenerationType, - DataReferenceCredentialType, - DataType, - DatastoreType, - DefaultActionType, - DefaultResourceProvisioningState, - DeploymentModelVersionUpgradeOption, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EndpointType, - EnvironmentType, - EnvironmentVariableType, - FeatureAttributionMetric, - FeatureDataType, - FeatureImportanceMode, - FeatureLags, - FeaturizationMode, - FineTuningTaskType, - FirewallSku, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - ImageType, - InputDeliveryMode, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogVerbosity, - ManagedNetworkKind, - ManagedNetworkProvisioningState, - ManagedNetworkStatus, - ManagedPERequirement, - ManagedPEStatus, - ManagedServiceIdentityType, - MarketplaceSubscriptionProvisioningState, - MarketplaceSubscriptionStatus, - MaterializationStoreType, - MlflowAutologger, - ModelLifecycleStatus, - ModelProvider, - ModelSize, - ModelTaskType, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringNotificationType, - MonitoringSignalType, - MountAction, - MountMode, - MountState, - NCrossValidationsMode, - Network, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - Origin, - OsType, - OutputDeliveryMode, - PatchStatus, - PendingUploadCredentialType, - PendingUploadType, - PoolProvisioningState, - PrivateEndpointConnectionProvisioningState, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccessType, - QuotaUnit, - RaiPolicyContentSource, - RaiPolicyMode, - RaiPolicyType, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleAction, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServerlessEndpointState, - ServerlessInferenceEndpointAuthMode, - ServiceAccountKeyName, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StochasticOptimizer, - StorageAccountType, - SystemDatastoresAuthMode, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - VmPriority, - VolumeDefinitionType, - VulnerabilityRisk, - WebhookType, - WeekDay, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AADAuthTypeWorkspaceConnectionProperties", - "AKS", - "AKSSchemaProperties", - "AccessKeyAuthTypeWorkspaceConnectionProperties", - "AccountApiKeys", - "AccountKeyAuthTypeWorkspaceConnectionProperties", - "AccountKeyDatastoreCredentials", - "AccountKeyDatastoreSecrets", - "AcrDetails", - "ActualCapacityInfo", - "AksComputeSecrets", - "AksNetworkingConfiguration", - "AllFeatures", - "AllNodes", - "AmlCompute", - "AmlComputeNodeInformation", - "AmlComputeProperties", - "AmlToken", - "AmlTokenComputeIdentity", - "AmlUserFeature", - "AnonymousAccessCredential", - "ApiKeyAuthWorkspaceConnectionProperties", - "ArmResourceId", - "AssetBase", - "AssetContainer", - "AssetReferenceBase", - "AssignedUser", - "AutoForecastHorizon", - "AutoMLJob", - "AutoMLVertical", - "AutoNCrossValidations", - "AutoPauseProperties", - "AutoScaleProperties", - "AutoSeasonality", - "AutoTargetLags", - "AutoTargetRollingWindowSize", - "AvailableQuota", - "AvailableQuotaProperties", - "AzureBlobDatastore", - "AzureDataLakeGen1Datastore", - "AzureDataLakeGen2Datastore", - "AzureDevOpsWebhook", - "AzureFileDatastore", - "AzureOpenAiFineTuning", - "AzureOpenAiHyperParameters", - "BanditPolicy", - "BatchDeployment", - "BatchDeploymentConfiguration", - "BatchDeploymentProperties", - "BatchEndpoint", - "BatchEndpointDefaults", - "BatchEndpointProperties", - "BatchPipelineComponentDeploymentConfiguration", - "BatchRetrySettings", - "BayesianSamplingAlgorithm", - "BindOptions", - "BlobReferenceForConsumptionDto", - "BuildContext", - "CapabilityHost", - "CapabilityHostProperties", - "CategoricalDataDriftMetricThreshold", - "CategoricalDataQualityMetricThreshold", - "CategoricalPredictionDriftMetricThreshold", - "CertificateDatastoreCredentials", - "CertificateDatastoreSecrets", - "Classification", - "ClassificationTrainingSettings", - "ClusterUpdateParameters", - "ClusterUpdateProperties", - "CodeConfiguration", - "CodeContainer", - "CodeContainerProperties", - "CodeVersion", - "CodeVersionProperties", - "CognitiveServicesSku", - "Collection", - "ColumnTransformer", - "CommandJob", - "CommandJobLimits", - "ComponentContainer", - "ComponentContainerProperties", - "ComponentVersion", - "ComponentVersionProperties", - "Compute", - "ComputeInstance", - "ComputeInstanceApplication", - "ComputeInstanceAutologgerSettings", - "ComputeInstanceConnectivityEndpoints", - "ComputeInstanceContainer", - "ComputeInstanceCreatedBy", - "ComputeInstanceDataDisk", - "ComputeInstanceDataMount", - "ComputeInstanceEnvironmentInfo", - "ComputeInstanceLastOperation", - "ComputeInstanceProperties", - "ComputeInstanceSshSettings", - "ComputeInstanceVersion", - "ComputeRecurrenceSchedule", - "ComputeResource", - "ComputeRuntimeDto", - "ComputeSchedules", - "ComputeSecrets", - "ComputeStartStopSchedule", - "ContainerResourceRequirements", - "ContainerResourceSettings", - "ContentSafety", - "ContentSafetyEndpointDeploymentResourceProperties", - "ContentSafetyEndpointResourceProperties", - "CosmosDbSettings", - "CreateMonitorAction", - "Cron", - "CronTrigger", - "CustomForecastHorizon", - "CustomKeys", - "CustomKeysWorkspaceConnectionProperties", - "CustomMetricThreshold", - "CustomModelFineTuning", - "CustomModelJobInput", - "CustomModelJobOutput", - "CustomMonitoringSignal", - "CustomNCrossValidations", - "CustomSeasonality", - "CustomService", - "CustomTargetLags", - "CustomTargetRollingWindowSize", - "DataCollector", - "DataContainer", - "DataContainerProperties", - "DataDriftMetricThresholdBase", - "DataDriftMonitoringSignal", - "DataFactory", - "DataGenerationVertical", - "DataLakeAnalytics", - "DataLakeAnalyticsSchemaProperties", - "DataPathAssetReference", - "DataQualityMetricThresholdBase", - "DataQualityMonitoringSignal", - "DataReferenceCredential", - "DataVersionBase", - "DataVersionBaseProperties", - "Databricks", - "DatabricksComputeSecrets", - "DatabricksProperties", - "DatasetReference", - "Datastore", - "DatastoreCredentials", - "DatastoreProperties", - "DatastoreSecrets", - "DefaultScaleSettings", - "DeltaModelCurrentState", - "DeltaModelListRequest", - "DeltaModelModifyRequest", - "DeltaModelStatusRequest", - "DeltaModelStatusResponse", - "DeploymentLogs", - "DeploymentLogsRequest", - "DeploymentResourceConfiguration", - "DestinationAsset", - "DiagnoseRequestProperties", - "DiagnoseResponseResult", - "DiagnoseResponseResultValue", - "DiagnoseResult", - "DiagnoseWorkspaceParameters", - "DistillationJob", - "DistributionConfiguration", - "Docker", - "DockerCredential", - "EarlyTerminationPolicy", - "EncryptionKeyVaultUpdateProperties", - "EncryptionProperty", - "EncryptionUpdateProperties", - "Endpoint", - "EndpointAuthKeys", - "EndpointAuthToken", - "EndpointDeploymentModel", - "EndpointDeploymentPropertiesBase", - "EndpointDeploymentResourceProperties", - "EndpointDeploymentResourcePropertiesBasicResource", - "EndpointKeys", - "EndpointModelDeprecationProperties", - "EndpointModelProperties", - "EndpointModelSkuCapacityProperties", - "EndpointModelSkuProperties", - "EndpointModelSkuRateLimitProperties", - "EndpointModelSkuRateLimitRulePatternProperties", - "EndpointModelSkuRateLimitRuleProperties", - "EndpointModels", - "EndpointPropertiesBase", - "EndpointResourceProperties", - "EndpointResourcePropertiesBasicResource", - "EndpointScheduleAction", - "EnvironmentContainer", - "EnvironmentContainerProperties", - "EnvironmentVariable", - "EnvironmentVersion", - "EnvironmentVersionProperties", - "ErrorAdditionalInfo", - "ErrorDetail", - "ErrorResponse", - "EstimatedVMPrice", - "EstimatedVMPrices", - "ExternalFQDNResponse", - "FQDNEndpoint", - "FQDNEndpointDetail", - "FQDNEndpoints", - "FQDNEndpointsPropertyBag", - "Feature", - "FeatureAttributionDriftMonitoringSignal", - "FeatureAttributionMetricThreshold", - "FeatureImportanceSettings", - "FeatureProperties", - "FeatureStoreSettings", - "FeatureSubset", - "FeatureWindow", - "FeaturesetContainer", - "FeaturesetContainerProperties", - "FeaturesetSpecification", - "FeaturesetVersion", - "FeaturesetVersionBackfillRequest", - "FeaturesetVersionBackfillResponse", - "FeaturesetVersionProperties", - "FeaturestoreEntityContainer", - "FeaturestoreEntityContainerProperties", - "FeaturestoreEntityVersion", - "FeaturestoreEntityVersionProperties", - "FeaturizationSettings", - "FineTuningJob", - "FineTuningVertical", - "FinetuningDetails", - "FixedInputData", - "FlavorData", - "ForecastHorizon", - "Forecasting", - "ForecastingSettings", - "ForecastingTrainingSettings", - "FqdnOutboundRule", - "GetBlobReferenceForConsumptionDto", - "GetBlobReferenceSASRequestDto", - "GetBlobReferenceSASResponseDto", - "GridSamplingAlgorithm", - "GroupEnvironmentConfiguration", - "GroupModelConfiguration", - "GroupStatus", - "HDInsight", - "HDInsightProperties", - "IPRule", - "IdAssetReference", - "IdentityConfiguration", - "IdentityForCmk", - "IdleShutdownSetting", - "Image", - "ImageClassification", - "ImageClassificationMultilabel", - "ImageDetails", - "ImageInfo", - "ImageInstanceSegmentation", - "ImageLimitSettings", - "ImageMetadata", - "ImageModelDistributionSettings", - "ImageModelDistributionSettingsClassification", - "ImageModelDistributionSettingsObjectDetection", - "ImageModelSettings", - "ImageModelSettingsClassification", - "ImageModelSettingsObjectDetection", - "ImageObjectDetection", - "ImageSweepSettings", - "IndexColumn", - "InferenceContainerProperties", - "InferenceEndpoint", - "InferenceEndpointProperties", - "InferenceGroup", - "InferenceGroupProperties", - "InferencePool", - "InferencePoolProperties", - "InstanceTypeSchema", - "InstanceTypeSchemaResources", - "JobBase", - "JobBaseProperties", - "JobInput", - "JobLimits", - "JobOutput", - "JobResourceConfiguration", - "JobResources", - "JobScheduleAction", - "JobService", - "JupyterKernelConfig", - "KeyVaultProperties", - "Kubernetes", - "KubernetesOnlineDeployment", - "KubernetesProperties", - "LabelGeneration", - "LakeHouseArtifact", - "ListNotebookKeysResult", - "ListStorageAccountKeysResult", - "ListWorkspaceKeysResult", - "LiteralJobInput", - "MLFlowModelJobInput", - "MLFlowModelJobOutput", - "MLTableData", - "MLTableJobInput", - "MLTableJobOutput", - "ManagedComputeIdentity", - "ManagedIdentity", - "ManagedIdentityAuthTypeWorkspaceConnectionProperties", - "ManagedIdentityCredential", - "ManagedNetworkProvisionOptions", - "ManagedNetworkProvisionStatus", - "ManagedNetworkSettings", - "ManagedNetworkSettingsBasicResource", - "ManagedNetworkSettingsEx", - "ManagedNetworkSettingsProperties", - "ManagedNetworkSettingsPropertiesBasicResource", - "ManagedOnlineDeployment", - "ManagedOnlineEndpointDeploymentResourceProperties", - "ManagedOnlineEndpointResourceProperties", - "ManagedResourceGroupAssignedIdentities", - "ManagedResourceGroupSettings", - "ManagedServiceIdentity", - "MarketplacePlan", - "MarketplaceSubscription", - "MarketplaceSubscriptionProperties", - "MaterializationComputeResource", - "MaterializationSettings", - "MedianStoppingPolicy", - "ModelContainer", - "ModelContainerProperties", - "ModelSettings", - "ModelVersion", - "ModelVersionProperties", - "MonitorComputeConfigurationBase", - "MonitorComputeIdentityBase", - "MonitorDefinition", - "MonitorEmailNotificationSettings", - "MonitorNotificationSettings", - "MonitorServerlessSparkCompute", - "MonitoringFeatureFilterBase", - "MonitoringInputDataBase", - "MonitoringSignalBase", - "MonitoringTarget", - "MonitoringThreshold", - "Mpi", - "NCrossValidations", - "NetworkAcls", - "NlpVerticalFeaturizationSettings", - "NlpVerticalLimitSettings", - "NodeStateCounts", - "Nodes", - "NoneAuthTypeWorkspaceConnectionProperties", - "NoneDatastoreCredentials", - "NotebookAccessTokenResult", - "NotebookPreparationError", - "NotebookResourceInfo", - "NotificationSetting", - "NumericalDataDriftMetricThreshold", - "NumericalDataQualityMetricThreshold", - "NumericalPredictionDriftMetricThreshold", - "OAuth2AuthTypeWorkspaceConnectionProperties", - "Objective", - "OneLakeArtifact", - "OneLakeDatastore", - "OnlineDeployment", - "OnlineDeploymentProperties", - "OnlineEndpoint", - "OnlineEndpointProperties", - "OnlineRequestSettings", - "OnlineScaleSettings", - "OpenAIEndpointDeploymentResourceProperties", - "OpenAIEndpointResourceProperties", - "Operation", - "OperationDisplay", - "OsPatchingStatus", - "OutboundRule", - "OutboundRuleBasicResource", - "OutputPathAssetReference", - "PATAuthTypeWorkspaceConnectionProperties", - "PTUDeploymentUsage", - "PackageDetails", - "PartialBatchDeployment", - "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - "PartialManagedServiceIdentity", - "PartialMinimalTrackedResource", - "PartialMinimalTrackedResourceWithIdentity", - "PartialMinimalTrackedResourceWithSku", - "PartialMinimalTrackedResourceWithSkuAndIdentity", - "PartialRegistryPartialTrackedResource", - "PartialSku", - "Password", - "PendingUploadCredentialDto", - "PendingUploadRequestDto", - "PendingUploadResponseDto", - "PersonalComputeInstanceSettings", - "PipelineJob", - "PredictionDriftMetricThresholdBase", - "PredictionDriftMonitoringSignal", - "PrivateEndpoint", - "PrivateEndpointConnection", - "PrivateEndpointConnectionProperties", - "PrivateEndpointDestination", - "PrivateEndpointOutboundRule", - "PrivateEndpointResource", - "PrivateLinkResource", - "PrivateLinkResourceProperties", - "PrivateLinkServiceConnectionState", - "ProbeSettings", - "PromptSettings", - "PropertiesBase", - "ProxyResource", - "PyTorch", - "QueueSettings", - "QuotaBaseProperties", - "QuotaUpdateParameters", - "RaiBlocklistConfig", - "RaiBlocklistItemBulkRequest", - "RaiBlocklistItemProperties", - "RaiBlocklistItemPropertiesBasicResource", - "RaiBlocklistProperties", - "RaiBlocklistPropertiesBasicResource", - "RaiPolicyContentFilter", - "RaiPolicyProperties", - "RaiPolicyPropertiesBasicResource", - "RandomSamplingAlgorithm", - "Recurrence", - "RecurrenceSchedule", - "RecurrenceTrigger", - "RegenerateEndpointKeysRequest", - "RegenerateServiceAccountKeyContent", - "Registry", - "RegistryListCredentialsResult", - "RegistryPartialManagedServiceIdentity", - "RegistryPrivateEndpointConnection", - "RegistryPrivateEndpointConnectionProperties", - "RegistryPrivateLinkServiceConnectionState", - "RegistryProperties", - "RegistryRegionArmDetails", - "Regression", - "RegressionTrainingSettings", - "RequestConfiguration", - "RequestLogging", - "ResizeSchema", - "Resource", - "ResourceBase", - "ResourceConfiguration", - "ResourceId", - "ResourceName", - "ResourceQuota", - "RollingInputData", - "Route", - "SASAuthTypeWorkspaceConnectionProperties", - "SASCredential", - "SASCredentialDto", - "SamplingAlgorithm", - "SasDatastoreCredentials", - "SasDatastoreSecrets", - "ScaleSettings", - "ScaleSettingsInformation", - "ScaleUnitConfiguration", - "Schedule", - "ScheduleActionBase", - "ScheduleBase", - "ScheduleProperties", - "ScriptReference", - "ScriptsToExecute", - "Seasonality", - "SecretExpiry", - "ServerlessComputeSettings", - "ServerlessEndpoint", - "ServerlessEndpointCapacityReservation", - "ServerlessEndpointContentSafety", - "ServerlessEndpointInferenceEndpoint", - "ServerlessEndpointModelSettings", - "ServerlessEndpointProperties", - "ServerlessEndpointResourceProperties", - "ServerlessInferenceEndpoint", - "ServerlessOffer", - "ServiceManagedResourcesSettings", - "ServicePrincipalAuthTypeWorkspaceConnectionProperties", - "ServicePrincipalDatastoreCredentials", - "ServicePrincipalDatastoreSecrets", - "ServiceTagDestination", - "ServiceTagOutboundRule", - "SetupScripts", - "SharedPrivateLinkResource", - "SharedPrivateLinkResourceProperty", - "Sku", - "SkuCapacity", - "SkuResource", - "SkuSetting", - "SparkJob", - "SparkJobEntry", - "SparkJobPythonEntry", - "SparkJobScalaEntry", - "SparkResourceConfiguration", - "SpeechEndpointDeploymentResourceProperties", - "SpeechEndpointResourceProperties", - "SslConfiguration", - "StackEnsembleSettings", - "StaticInputData", - "StorageAccountDetails", - "StringStringKeyValuePair", - "SweepJob", - "SweepJobLimits", - "SynapseSpark", - "SynapseSparkProperties", - "SystemCreatedAcrAccount", - "SystemCreatedStorageAccount", - "SystemData", - "SystemService", - "TableVerticalFeaturizationSettings", - "TableVerticalLimitSettings", - "TargetLags", - "TargetRollingWindowSize", - "TargetUtilizationScaleSettings", - "TeacherModelEndpoint", - "TeacherModelEndpointRequestSettings", - "TeacherModelSettings", - "TensorFlow", - "TextClassification", - "TextClassificationMultilabel", - "TextNer", - "TmpfsOptions", - "TopNFeaturesByAttribution", - "TrackedResource", - "TrainingSettings", - "TrialComponent", - "TriggerBase", - "TritonModelJobInput", - "TritonModelJobOutput", - "TruncationSelectionPolicy", - "UpdateWorkspaceQuotas", - "UpdateWorkspaceQuotasResult", - "UriFileDataVersion", - "UriFileJobInput", - "UriFileJobOutput", - "UriFolderDataVersion", - "UriFolderJobInput", - "UriFolderJobOutput", - "Usage", - "UsageAndQuotaDetails", - "UsageName", - "UserAccountCredentials", - "UserAssignedIdentity", - "UserIdentity", - "UsernamePasswordAuthTypeWorkspaceConnectionProperties", - "VirtualMachine", - "VirtualMachineImage", - "VirtualMachineSchemaProperties", - "VirtualMachineSecrets", - "VirtualMachineSize", - "VirtualMachineSizeListResult", - "VirtualMachineSshCredentials", - "VolumeDefinition", - "VolumeOptions", - "VulnerabilityDetails", - "VulnerabilityFindings", - "Webhook", - "Workspace", - "WorkspaceConnectionAccessKey", - "WorkspaceConnectionAccountKey", - "WorkspaceConnectionApiKey", - "WorkspaceConnectionManagedIdentity", - "WorkspaceConnectionOAuth2", - "WorkspaceConnectionPersonalAccessToken", - "WorkspaceConnectionPropertiesV2", - "WorkspaceConnectionPropertiesV2BasicResource", - "WorkspaceConnectionServicePrincipal", - "WorkspaceConnectionSharedAccessSignature", - "WorkspaceConnectionUpdateParameter", - "WorkspaceConnectionUsernamePassword", - "WorkspaceHubConfig", - "WorkspacePrivateEndpointResource", - "WorkspaceProperties", - "WorkspacePropertiesUpdateParameters", - "WorkspaceUpdateParameters", - "ActionType", - "AllocationState", - "AllowedContentLevel", - "ApplicationSharingPolicy", - "AssetProvisioningState", - "AuthMode", - "AutoRebuildSetting", - "Autosave", - "BatchDeploymentConfigurationType", - "BatchLoggingLevel", - "BatchOutputAction", - "BillingCurrency", - "BlockedTransformers", - "Caching", - "CapabilityHostKind", - "CapabilityHostProvisioningState", - "CategoricalDataDriftMetric", - "CategoricalDataQualityMetric", - "CategoricalPredictionDriftMetric", - "ClassificationModels", - "ClassificationMultilabelPrimaryMetrics", - "ClassificationPrimaryMetrics", - "ClusterPurpose", - "ComputeInstancePropertiesComputeInstanceAuthorizationType", - "ComputeInstanceState", - "ComputePowerAction", - "ComputeRecurrenceFrequency", - "ComputeTriggerType", - "ComputeType", - "ComputeWeekDay", - "ConnectionAuthType", - "ConnectionCategory", - "ConnectionGroup", - "ContainerType", - "ContentSafetyLevel", - "ContentSafetyStatus", - "CreatedByType", - "CredentialsType", - "DataAvailabilityStatus", - "DataCollectionMode", - "DataGenerationTaskType", - "DataGenerationType", - "DataReferenceCredentialType", - "DataType", - "DatastoreType", - "DefaultActionType", - "DefaultResourceProvisioningState", - "DeploymentModelVersionUpgradeOption", - "DeploymentProvisioningState", - "DiagnoseResultLevel", - "DistributionType", - "EarlyTerminationPolicyType", - "EgressPublicNetworkAccessType", - "EmailNotificationEnableType", - "EncryptionStatus", - "EndpointAuthMode", - "EndpointComputeType", - "EndpointProvisioningState", - "EndpointServiceConnectionStatus", - "EndpointType", - "EnvironmentType", - "EnvironmentVariableType", - "FeatureAttributionMetric", - "FeatureDataType", - "FeatureImportanceMode", - "FeatureLags", - "FeaturizationMode", - "FineTuningTaskType", - "FirewallSku", - "ForecastHorizonMode", - "ForecastingModels", - "ForecastingPrimaryMetrics", - "Goal", - "IdentityConfigurationType", - "ImageType", - "InputDeliveryMode", - "InstanceSegmentationPrimaryMetrics", - "IsolationMode", - "JobInputType", - "JobLimitsType", - "JobOutputType", - "JobStatus", - "JobTier", - "JobType", - "KeyType", - "LearningRateScheduler", - "ListViewType", - "LoadBalancerType", - "LogVerbosity", - "ManagedNetworkKind", - "ManagedNetworkProvisioningState", - "ManagedNetworkStatus", - "ManagedPERequirement", - "ManagedPEStatus", - "ManagedServiceIdentityType", - "MarketplaceSubscriptionProvisioningState", - "MarketplaceSubscriptionStatus", - "MaterializationStoreType", - "MlflowAutologger", - "ModelLifecycleStatus", - "ModelProvider", - "ModelSize", - "ModelTaskType", - "MonitorComputeIdentityType", - "MonitorComputeType", - "MonitoringFeatureDataType", - "MonitoringFeatureFilterType", - "MonitoringInputDataType", - "MonitoringNotificationType", - "MonitoringSignalType", - "MountAction", - "MountMode", - "MountState", - "NCrossValidationsMode", - "Network", - "NodeState", - "NodesValueType", - "NumericalDataDriftMetric", - "NumericalDataQualityMetric", - "NumericalPredictionDriftMetric", - "ObjectDetectionPrimaryMetrics", - "OneLakeArtifactType", - "OperatingSystemType", - "OperationName", - "OperationStatus", - "OperationTrigger", - "OrderString", - "Origin", - "OsType", - "OutputDeliveryMode", - "PatchStatus", - "PendingUploadCredentialType", - "PendingUploadType", - "PoolProvisioningState", - "PrivateEndpointConnectionProvisioningState", - "Protocol", - "ProvisioningState", - "ProvisioningStatus", - "PublicNetworkAccessType", - "QuotaUnit", - "RaiPolicyContentSource", - "RaiPolicyMode", - "RaiPolicyType", - "RandomSamplingAlgorithmRule", - "RecurrenceFrequency", - "ReferenceType", - "RegressionModels", - "RegressionPrimaryMetrics", - "RemoteLoginPortPublicAccess", - "RollingRateType", - "RuleAction", - "RuleCategory", - "RuleStatus", - "RuleType", - "SamplingAlgorithmType", - "ScaleType", - "ScheduleActionType", - "ScheduleListViewType", - "ScheduleProvisioningState", - "ScheduleProvisioningStatus", - "ScheduleStatus", - "SeasonalityMode", - "SecretsType", - "ServerlessEndpointState", - "ServerlessInferenceEndpointAuthMode", - "ServiceAccountKeyName", - "ServiceDataAccessAuthIdentity", - "ShortSeriesHandlingConfiguration", - "SkuScaleType", - "SkuTier", - "SourceType", - "SparkJobEntryType", - "SshPublicAccess", - "SslConfigStatus", - "StackMetaLearnerType", - "Status", - "StochasticOptimizer", - "StorageAccountType", - "SystemDatastoresAuthMode", - "TargetAggregationFunction", - "TargetLagsMode", - "TargetRollingWindowSizeMode", - "TaskType", - "TriggerType", - "UnderlyingResourceAction", - "UnitOfMeasure", - "UsageUnit", - "UseStl", - "VMPriceOSType", - "VMTier", - "ValidationMetricType", - "VmPriority", - "VolumeDefinitionType", - "VulnerabilityRisk", - "WebhookType", - "WeekDay", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_enums.py deleted file mode 100644 index 145bdc987398..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_enums.py +++ /dev/null @@ -1,2889 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal - only APIs. - """ - - INTERNAL = "Internal" - """Actions are for internal-only APIs.""" - - -class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - """STEADY.""" - RESIZING = "Resizing" - """RESIZING.""" - - -class AllowedContentLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level at which content is filtered.""" - - LOW = "Low" - """LOW.""" - MEDIUM = "Medium" - """MEDIUM.""" - HIGH = "High" - """HIGH.""" - - -class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - """PERSONAL.""" - SHARED = "Shared" - """SHARED.""" - - -class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset.""" - - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - CANCELED = "Canceled" - """CANCELED.""" - CREATING = "Creating" - """CREATING.""" - UPDATING = "Updating" - """UPDATING.""" - DELETING = "Deleting" - """DELETING.""" - - -class AuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode.""" - - AAD = "AAD" - """AAD.""" - - -class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image.""" - - DISABLED = "Disabled" - """DISABLED.""" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - """ON_BASE_IMAGE_UPDATE.""" - - -class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings.""" - - NONE = "None" - """NONE.""" - LOCAL = "Local" - """LOCAL.""" - REMOTE = "Remote" - """REMOTE.""" - - -class BatchDeploymentConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated property types for batch deployments.""" - - MODEL = "Model" - """MODEL.""" - PIPELINE_COMPONENT = "PipelineComponent" - """PIPELINE_COMPONENT.""" - - -class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info - and Debug. The default value is Info. - """ - - INFO = "Info" - """INFO.""" - WARNING = "Warning" - """WARNING.""" - DEBUG = "Debug" - """DEBUG.""" - - -class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output.""" - - SUMMARY_ONLY = "SummaryOnly" - """SUMMARY_ONLY.""" - APPEND_ROW = "AppendRow" - """APPEND_ROW.""" - - -class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD.""" - - USD = "USD" - """USD.""" - - -class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML.""" - - TEXT_TARGET_ENCODER = "TextTargetEncoder" - """Target encoding for text data.""" - ONE_HOT_ENCODER = "OneHotEncoder" - """Ohe hot encoding creates a binary feature transformation.""" - CAT_TARGET_ENCODER = "CatTargetEncoder" - """Target encoding for categorical data.""" - TF_IDF = "TfIdf" - """Tf-Idf stands for, term-frequency times inverse document-frequency. This is a common term - weighting scheme for identifying information from documents.""" - WO_E_TARGET_ENCODER = "WoETargetEncoder" - """Weight of Evidence encoding is a technique used to encode categorical variables. It uses the - natural log of the P(1)/P(0) to create weights.""" - LABEL_ENCODER = "LabelEncoder" - """Label encoder converts labels/categorical variables in a numerical form.""" - WORD_EMBEDDING = "WordEmbedding" - """Word embedding helps represents words or phrases as a vector, or a series of numbers.""" - NAIVE_BAYES = "NaiveBayes" - """Naive Bayes is a classified that is used for classification of discrete features that are - categorically distributed.""" - COUNT_VECTORIZER = "CountVectorizer" - """Count Vectorizer converts a collection of text documents to a matrix of token counts.""" - HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" - """Hashing One Hot Encoder can turn categorical variables into a limited number of new features. - This is often used for high-cardinality categorical features.""" - - -class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk.""" - - NONE = "None" - """NONE.""" - READ_ONLY = "ReadOnly" - """READ_ONLY.""" - READ_WRITE = "ReadWrite" - """READ_WRITE.""" - - -class CapabilityHostKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CapabilityHostKind.""" - - AGENTS = "Agents" - """AGENTS.""" - - -class CapabilityHostProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of capability host.""" - - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - CANCELED = "Canceled" - """CANCELED.""" - CREATING = "Creating" - """CREATING.""" - UPDATING = "Updating" - """UPDATING.""" - DELETING = "Deleting" - """DELETING.""" - - -class CategoricalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CategoricalDataDriftMetric.""" - - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - """The Jensen Shannon Distance (JSD) metric.""" - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - """The Population Stability Index (PSI) metric.""" - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - """The Pearsons Chi Squared Test metric.""" - - -class CategoricalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CategoricalDataQualityMetric.""" - - NULL_VALUE_RATE = "NullValueRate" - """Calculates the rate of null values.""" - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - """Calculates the rate of data type errors.""" - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - """Calculates the rate values are out of bounds.""" - - -class CategoricalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CategoricalPredictionDriftMetric.""" - - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - """The Jensen Shannon Distance (JSD) metric.""" - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - """The Population Stability Index (PSI) metric.""" - PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" - """The Pearsons Chi Squared Test metric.""" - - -class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML.""" - - LOGISTIC_REGRESSION = "LogisticRegression" - """Logistic regression is a fundamental classification technique. It belongs to the group of - linear classifiers and is somewhat similar to polynomial and linear regression. Logistic - regression is fast and relatively uncomplicated, and it's convenient for you to interpret the - results. Although it's essentially a method for binary classification, it can also be applied - to multiclass problems.""" - SGD = "SGD" - """SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - applications to find the model parameters that correspond to the best fit between predicted and - actual outputs.""" - MULTINOMIAL_NAIVE_BAYES = "MultinomialNaiveBayes" - """The multinomial Naive Bayes classifier is suitable for classification with discrete features - (e.g., word counts for text classification). The multinomial distribution normally requires - integer feature counts. However, in practice, fractional counts such as tf-idf may also work.""" - BERNOULLI_NAIVE_BAYES = "BernoulliNaiveBayes" - """Naive Bayes classifier for multivariate Bernoulli models.""" - SVM = "SVM" - """A support vector machine (SVM) is a supervised machine learning model that uses classification - algorithms for two-group classification problems. After giving an SVM model sets of labeled - training data for each category, they're able to categorize new text.""" - LINEAR_SVM = "LinearSVM" - """A support vector machine (SVM) is a supervised machine learning model that uses classification - algorithms for two-group classification problems. After giving an SVM model sets of labeled - training data for each category, they're able to categorize new text. Linear SVM performs best - when input data is linear, i.e., data can be easily classified by drawing the straight line - between classified values on a plotted graph.""" - KNN = "KNN" - """K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - datapoints which further means that the new data point will be assigned a value based on how - closely it matches the points in the training set.""" - DECISION_TREE = "DecisionTree" - """Decision Trees are a non-parametric supervised learning method used for both classification and - regression tasks. The goal is to create a model that predicts the value of a target variable by - learning simple decision rules inferred from the data features.""" - RANDOM_FOREST = "RandomForest" - """Random forest is a supervised learning algorithm. The "forest" it builds, is an ensemble of - decision trees, usually trained with the "bagging" method. The general idea of the bagging - method is that a combination of learning models increases the overall result.""" - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - """Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - decision trees. It is related to the widely used random forest algorithm.""" - LIGHT_GBM = "LightGBM" - """LightGBM is a gradient boosting framework that uses tree based learning algorithms.""" - GRADIENT_BOOSTING = "GradientBoosting" - """The technique of transiting week learners into a strong learner is called Boosting. The - gradient boosting algorithm process works on this theory of execution.""" - XG_BOOST_CLASSIFIER = "XGBoostClassifier" - """XGBoost: Extreme Gradient Boosting Algorithm. This algorithm is used for structured data where - target column values can be divided into distinct class values.""" - - -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks.""" - - AUC_WEIGHTED = "AUCWeighted" - """AUC is the Area under the curve. This metric represents arithmetic mean of the score for each - class, weighted by the number of true instances in each class.""" - ACCURACY = "Accuracy" - """Accuracy is the ratio of predictions that exactly match the true class labels.""" - NORM_MACRO_RECALL = "NormMacroRecall" - """Normalized macro recall is recall macro-averaged and normalized, so that random performance has - a score of 0, and perfect performance has a score of 1.""" - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - """The arithmetic mean of the average precision score for each class, weighted by the number of - true instances in each class.""" - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - """The arithmetic mean of precision for each class, weighted by number of true instances in each - class.""" - IOU = "IOU" - """Intersection Over Union. Intersection of predictions divided by union of predictions.""" - - -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks.""" - - AUC_WEIGHTED = "AUCWeighted" - """AUC is the Area under the curve. This metric represents arithmetic mean of the score for each - class, weighted by the number of true instances in each class.""" - ACCURACY = "Accuracy" - """Accuracy is the ratio of predictions that exactly match the true class labels.""" - NORM_MACRO_RECALL = "NormMacroRecall" - """Normalized macro recall is recall macro-averaged and normalized, so that random performance has - a score of 0, and perfect performance has a score of 1.""" - AVERAGE_PRECISION_SCORE_WEIGHTED = "AveragePrecisionScoreWeighted" - """The arithmetic mean of the average precision score for each class, weighted by the number of - true instances in each class.""" - PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" - """The arithmetic mean of precision for each class, weighted by number of true instances in each - class.""" - - -class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster.""" - - FAST_PROD = "FastProd" - """FAST_PROD.""" - DENSE_PROD = "DenseProd" - """DENSE_PROD.""" - DEV_TEST = "DevTest" - """DEV_TEST.""" - - -class ComputeInstancePropertiesComputeInstanceAuthorizationType( # pylint: disable=name-too-long - str, Enum, metaclass=CaseInsensitiveEnumMeta -): - """The Compute Instance Authorization type. Available values are personal (default).""" - - PERSONAL = "personal" - """PERSONAL.""" - - -class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance.""" - - CREATING = "Creating" - """CREATING.""" - CREATE_FAILED = "CreateFailed" - """CREATE_FAILED.""" - DELETING = "Deleting" - """DELETING.""" - RUNNING = "Running" - """RUNNING.""" - RESTARTING = "Restarting" - """RESTARTING.""" - RESIZING = "Resizing" - """RESIZING.""" - JOB_RUNNING = "JobRunning" - """JOB_RUNNING.""" - SETTING_UP = "SettingUp" - """SETTING_UP.""" - SETUP_FAILED = "SetupFailed" - """SETUP_FAILED.""" - STARTING = "Starting" - """STARTING.""" - STOPPED = "Stopped" - """STOPPED.""" - STOPPING = "Stopping" - """STOPPING.""" - USER_SETTING_UP = "UserSettingUp" - """USER_SETTING_UP.""" - USER_SETUP_FAILED = "UserSetupFailed" - """USER_SETUP_FAILED.""" - UNKNOWN = "Unknown" - """UNKNOWN.""" - UNUSABLE = "Unusable" - """UNUSABLE.""" - - -class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """[Required] The compute power action.""" - - START = "Start" - """START.""" - STOP = "Stop" - """STOP.""" - - -class ComputeRecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a compute recurrence schedule.""" - - MINUTE = "Minute" - """Minute frequency.""" - HOUR = "Hour" - """Hour frequency.""" - DAY = "Day" - """Day frequency.""" - WEEK = "Week" - """Week frequency.""" - MONTH = "Month" - """Month frequency.""" - - -class ComputeTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ComputeTriggerType.""" - - RECURRENCE = "Recurrence" - """RECURRENCE.""" - CRON = "Cron" - """CRON.""" - - -class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute.""" - - AKS = "AKS" - """AKS.""" - KUBERNETES = "Kubernetes" - """KUBERNETES.""" - AML_COMPUTE = "AmlCompute" - """AML_COMPUTE.""" - COMPUTE_INSTANCE = "ComputeInstance" - """COMPUTE_INSTANCE.""" - DATA_FACTORY = "DataFactory" - """DATA_FACTORY.""" - VIRTUAL_MACHINE = "VirtualMachine" - """VIRTUAL_MACHINE.""" - HD_INSIGHT = "HDInsight" - """HD_INSIGHT.""" - DATABRICKS = "Databricks" - """DATABRICKS.""" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - """DATA_LAKE_ANALYTICS.""" - SYNAPSE_SPARK = "SynapseSpark" - """SYNAPSE_SPARK.""" - - -class ComputeWeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday.""" - - MONDAY = "Monday" - """Monday weekday.""" - TUESDAY = "Tuesday" - """Tuesday weekday.""" - WEDNESDAY = "Wednesday" - """Wednesday weekday.""" - THURSDAY = "Thursday" - """Thursday weekday.""" - FRIDAY = "Friday" - """Friday weekday.""" - SATURDAY = "Saturday" - """Saturday weekday.""" - SUNDAY = "Sunday" - """Sunday weekday.""" - - -class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target.""" - - PAT = "PAT" - """PAT.""" - MANAGED_IDENTITY = "ManagedIdentity" - """MANAGED_IDENTITY.""" - USERNAME_PASSWORD = "UsernamePassword" - """USERNAME_PASSWORD.""" - NONE = "None" - """NONE.""" - SAS = "SAS" - """SAS.""" - ACCOUNT_KEY = "AccountKey" - """ACCOUNT_KEY.""" - SERVICE_PRINCIPAL = "ServicePrincipal" - """SERVICE_PRINCIPAL.""" - ACCESS_KEY = "AccessKey" - """ACCESS_KEY.""" - API_KEY = "ApiKey" - """API_KEY.""" - CUSTOM_KEYS = "CustomKeys" - """CUSTOM_KEYS.""" - O_AUTH2 = "OAuth2" - """O_AUTH2.""" - AAD = "AAD" - """AAD.""" - DELEGATED_SAS = "DelegatedSAS" - """DELEGATED_SAS.""" - PROJECT_MANAGED_IDENTITY = "ProjectManagedIdentity" - """PROJECT_MANAGED_IDENTITY.""" - ACCOUNT_MANAGED_IDENTITY = "AccountManagedIdentity" - """ACCOUNT_MANAGED_IDENTITY.""" - USER_ENTRA_TOKEN = "UserEntraToken" - """USER_ENTRA_TOKEN.""" - AGENT_USER_IMPERSONATION = "AgentUserImpersonation" - """AGENT_USER_IMPERSONATION.""" - AGENTIC_IDENTITY_TOKEN = "AgenticIdentityToken" - """AGENTIC_IDENTITY_TOKEN.""" - AGENTIC_USER = "AgenticUser" - """AGENTIC_USER.""" - - -class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection.""" - - PYTHON_FEED = "PythonFeed" - """PYTHON_FEED.""" - CONTAINER_REGISTRY = "ContainerRegistry" - """CONTAINER_REGISTRY.""" - GIT = "Git" - """GIT.""" - S3 = "S3" - """S3.""" - SNOWFLAKE = "Snowflake" - """SNOWFLAKE.""" - AZURE_KEY_VAULT = "AzureKeyVault" - """AZURE_KEY_VAULT.""" - AZURE_SQL_DB = "AzureSqlDb" - """AZURE_SQL_DB.""" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - """AZURE_SYNAPSE_ANALYTICS.""" - AZURE_MY_SQL_DB = "AzureMySqlDb" - """AZURE_MY_SQL_DB.""" - AZURE_POSTGRES_DB = "AzurePostgresDb" - """AZURE_POSTGRES_DB.""" - ADLS_GEN2 = "ADLSGen2" - """ADLS_GEN2.""" - AZURE_CONTAINER_APP_ENVIRONMENT = "AzureContainerAppEnvironment" - """AZURE_CONTAINER_APP_ENVIRONMENT.""" - REDIS = "Redis" - """REDIS.""" - API_KEY = "ApiKey" - """API_KEY.""" - AZURE_OPEN_AI = "AzureOpenAI" - """AZURE_OPEN_AI.""" - AI_SERVICES = "AIServices" - """AI_SERVICES.""" - COGNITIVE_SEARCH = "CognitiveSearch" - """COGNITIVE_SEARCH.""" - COGNITIVE_SERVICE = "CognitiveService" - """COGNITIVE_SERVICE.""" - CUSTOM_KEYS = "CustomKeys" - """CUSTOM_KEYS.""" - AZURE_BLOB = "AzureBlob" - """AZURE_BLOB.""" - AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" - """AZURE_STORAGE_ACCOUNT.""" - AZURE_ONE_LAKE = "AzureOneLake" - """AZURE_ONE_LAKE.""" - COSMOS_DB = "CosmosDb" - """COSMOS_DB.""" - COSMOS_DB_MONGO_DB_API = "CosmosDbMongoDbApi" - """COSMOS_DB_MONGO_DB_API.""" - AZURE_DATA_EXPLORER = "AzureDataExplorer" - """AZURE_DATA_EXPLORER.""" - AZURE_MARIA_DB = "AzureMariaDb" - """AZURE_MARIA_DB.""" - AZURE_DATABRICKS_DELTA_LAKE = "AzureDatabricksDeltaLake" - """AZURE_DATABRICKS_DELTA_LAKE.""" - AZURE_SQL_MI = "AzureSqlMi" - """AZURE_SQL_MI.""" - AZURE_TABLE_STORAGE = "AzureTableStorage" - """AZURE_TABLE_STORAGE.""" - AMAZON_RDS_FOR_ORACLE = "AmazonRdsForOracle" - """AMAZON_RDS_FOR_ORACLE.""" - AMAZON_RDS_FOR_SQL_SERVER = "AmazonRdsForSqlServer" - """AMAZON_RDS_FOR_SQL_SERVER.""" - AMAZON_REDSHIFT = "AmazonRedshift" - """AMAZON_REDSHIFT.""" - DB2 = "Db2" - """DB2.""" - DRILL = "Drill" - """DRILL.""" - GOOGLE_BIG_QUERY = "GoogleBigQuery" - """GOOGLE_BIG_QUERY.""" - GREENPLUM = "Greenplum" - """GREENPLUM.""" - HBASE = "Hbase" - """HBASE.""" - HIVE = "Hive" - """HIVE.""" - IMPALA = "Impala" - """IMPALA.""" - INFORMIX = "Informix" - """INFORMIX.""" - MARIA_DB = "MariaDb" - """MARIA_DB.""" - MICROSOFT_ACCESS = "MicrosoftAccess" - """MICROSOFT_ACCESS.""" - MY_SQL = "MySql" - """MY_SQL.""" - NETEZZA = "Netezza" - """NETEZZA.""" - ORACLE = "Oracle" - """ORACLE.""" - PHOENIX = "Phoenix" - """PHOENIX.""" - POSTGRE_SQL = "PostgreSql" - """POSTGRE_SQL.""" - PRESTO = "Presto" - """PRESTO.""" - SAP_OPEN_HUB = "SapOpenHub" - """SAP_OPEN_HUB.""" - SAP_BW = "SapBw" - """SAP_BW.""" - SAP_HANA = "SapHana" - """SAP_HANA.""" - SAP_TABLE = "SapTable" - """SAP_TABLE.""" - SPARK = "Spark" - """SPARK.""" - SQL_SERVER = "SqlServer" - """SQL_SERVER.""" - SYBASE = "Sybase" - """SYBASE.""" - TERADATA = "Teradata" - """TERADATA.""" - VERTICA = "Vertica" - """VERTICA.""" - PINECONE = "Pinecone" - """PINECONE.""" - DATABRICKS = "Databricks" - """DATABRICKS.""" - CASSANDRA = "Cassandra" - """CASSANDRA.""" - COUCHBASE = "Couchbase" - """COUCHBASE.""" - MONGO_DB_V2 = "MongoDbV2" - """MONGO_DB_V2.""" - MONGO_DB_ATLAS = "MongoDbAtlas" - """MONGO_DB_ATLAS.""" - AMAZON_S3_COMPATIBLE = "AmazonS3Compatible" - """AMAZON_S3_COMPATIBLE.""" - FILE_SERVER = "FileServer" - """FILE_SERVER.""" - FTP_SERVER = "FtpServer" - """FTP_SERVER.""" - GOOGLE_CLOUD_STORAGE = "GoogleCloudStorage" - """GOOGLE_CLOUD_STORAGE.""" - HDFS = "Hdfs" - """HDFS.""" - ORACLE_CLOUD_STORAGE = "OracleCloudStorage" - """ORACLE_CLOUD_STORAGE.""" - SFTP = "Sftp" - """SFTP.""" - GENERIC_HTTP = "GenericHttp" - """GENERIC_HTTP.""" - O_DATA_REST = "ODataRest" - """O_DATA_REST.""" - ODBC = "Odbc" - """ODBC.""" - GENERIC_REST = "GenericRest" - """GENERIC_REST.""" - REMOTE_TOOL = "RemoteTool" - """REMOTE_TOOL.""" - AMAZON_MWS = "AmazonMws" - """AMAZON_MWS.""" - CONCUR = "Concur" - """CONCUR.""" - DYNAMICS = "Dynamics" - """DYNAMICS.""" - DYNAMICS_AX = "DynamicsAx" - """DYNAMICS_AX.""" - DYNAMICS_CRM = "DynamicsCrm" - """DYNAMICS_CRM.""" - GOOGLE_AD_WORDS = "GoogleAdWords" - """GOOGLE_AD_WORDS.""" - HUBSPOT = "Hubspot" - """HUBSPOT.""" - JIRA = "Jira" - """JIRA.""" - MAGENTO = "Magento" - """MAGENTO.""" - MARKETO = "Marketo" - """MARKETO.""" - OFFICE365 = "Office365" - """OFFICE365.""" - ELOQUA = "Eloqua" - """ELOQUA.""" - RESPONSYS = "Responsys" - """RESPONSYS.""" - ORACLE_SERVICE_CLOUD = "OracleServiceCloud" - """ORACLE_SERVICE_CLOUD.""" - PAY_PAL = "PayPal" - """PAY_PAL.""" - QUICK_BOOKS = "QuickBooks" - """QUICK_BOOKS.""" - SALESFORCE = "Salesforce" - """SALESFORCE.""" - SALESFORCE_SERVICE_CLOUD = "SalesforceServiceCloud" - """SALESFORCE_SERVICE_CLOUD.""" - SALESFORCE_MARKETING_CLOUD = "SalesforceMarketingCloud" - """SALESFORCE_MARKETING_CLOUD.""" - SAP_CLOUD_FOR_CUSTOMER = "SapCloudForCustomer" - """SAP_CLOUD_FOR_CUSTOMER.""" - SAP_ECC = "SapEcc" - """SAP_ECC.""" - SERVICE_NOW = "ServiceNow" - """SERVICE_NOW.""" - SHARE_POINT_ONLINE_LIST = "SharePointOnlineList" - """SHARE_POINT_ONLINE_LIST.""" - SHOPIFY = "Shopify" - """SHOPIFY.""" - SQUARE = "Square" - """SQUARE.""" - WEB_TABLE = "WebTable" - """WEB_TABLE.""" - XERO = "Xero" - """XERO.""" - ZOHO = "Zoho" - """ZOHO.""" - GENERIC_CONTAINER_REGISTRY = "GenericContainerRegistry" - """GENERIC_CONTAINER_REGISTRY.""" - ELASTICSEARCH = "Elasticsearch" - """ELASTICSEARCH.""" - APP_INSIGHTS = "AppInsights" - """APP_INSIGHTS.""" - APP_CONFIG = "AppConfig" - """APP_CONFIG.""" - OPEN_AI = "OpenAI" - """OPEN_AI.""" - SERP = "Serp" - """SERP.""" - BING_LLM_SEARCH = "BingLLMSearch" - """BING_LLM_SEARCH.""" - SERVERLESS = "Serverless" - """SERVERLESS.""" - MANAGED_ONLINE_ENDPOINT = "ManagedOnlineEndpoint" - """MANAGED_ONLINE_ENDPOINT.""" - API_MANAGEMENT = "ApiManagement" - """API_MANAGEMENT.""" - MODEL_GATEWAY = "ModelGateway" - """MODEL_GATEWAY.""" - GROUNDING_WITH_BING_SEARCH = "GroundingWithBingSearch" - """GROUNDING_WITH_BING_SEARCH.""" - GROUNDING_WITH_CUSTOM_SEARCH = "GroundingWithCustomSearch" - """GROUNDING_WITH_CUSTOM_SEARCH.""" - SHAREPOINT = "Sharepoint" - """SHAREPOINT.""" - MICROSOFT_FABRIC = "MicrosoftFabric" - """MICROSOFT_FABRIC.""" - POWER_PLATFORM_ENVIRONMENT = "PowerPlatformEnvironment" - """POWER_PLATFORM_ENVIRONMENT.""" - REMOTE_A2_A = "RemoteA2A" - """REMOTE_A2_A.""" - - -class ConnectionGroup(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Group based on connection category.""" - - AZURE = "Azure" - """AZURE.""" - AZURE_AI = "AzureAI" - """AZURE_AI.""" - DATABASE = "Database" - """DATABASE.""" - NO_SQL = "NoSQL" - """NO_SQL.""" - FILE = "File" - """FILE.""" - GENERIC_PROTOCOL = "GenericProtocol" - """GENERIC_PROTOCOL.""" - SERVICES_AND_APPS = "ServicesAndApps" - """SERVICES_AND_APPS.""" - - -class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ContainerType.""" - - STORAGE_INITIALIZER = "StorageInitializer" - """STORAGE_INITIALIZER.""" - INFERENCE_SERVER = "InferenceServer" - """INFERENCE_SERVER.""" - - -class ContentSafetyLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the current safety level for content safety.""" - - BLOCKING = "Blocking" - """BLOCKING.""" - DEFERRED = "Deferred" - """DEFERRED.""" - - -class ContentSafetyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the status of content safety.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The kind of entity that created the resource.""" - - USER = "User" - """The entity was created by a user.""" - APPLICATION = "Application" - """The entity was created by an application.""" - MANAGED_IDENTITY = "ManagedIdentity" - """The entity was created by a managed identity.""" - KEY = "Key" - """The entity was created by a key.""" - - -class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type.""" - - ACCOUNT_KEY = "AccountKey" - """ACCOUNT_KEY.""" - CERTIFICATE = "Certificate" - """CERTIFICATE.""" - NONE = "None" - """NONE.""" - SAS = "Sas" - """SAS.""" - SERVICE_PRINCIPAL = "ServicePrincipal" - """SERVICE_PRINCIPAL.""" - - -class DataAvailabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of DataAvailabilityStatus.""" - - NONE = "None" - """NONE.""" - PENDING = "Pending" - """PENDING.""" - INCOMPLETE = "Incomplete" - """INCOMPLETE.""" - COMPLETE = "Complete" - """COMPLETE.""" - - -class DataCollectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of DataCollectionMode.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class DataGenerationTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of Data Generation Task.""" - - CONVERSATION = "Conversation" - """Generate conversational data (multi/single turn).""" - MATH = "Math" - """Generate Math data for numerical responses.""" - NLI = "Nli" - """Generate Natural Language Inference data.""" - NLU_QA = "NluQa" - """Generate Natural Language Understanding data for Question Answering data.""" - SUMMARIZATION = "Summarization" - """Generate Key Summary for an Article.""" - - -class DataGenerationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of Data Generation.""" - - LABEL_GENERATION = "LabelGeneration" - """Label Generation by Teacher Model Inferencing.""" - DATA_GENERATION = "DataGeneration" - """Synthetic Data Generation.""" - - -class DataReferenceCredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the DataReference credentials type.""" - - SAS = "SAS" - """SAS.""" - DOCKER_CREDENTIALS = "DockerCredentials" - """DOCKER_CREDENTIALS.""" - MANAGED_IDENTITY = "ManagedIdentity" - """MANAGED_IDENTITY.""" - NO_CREDENTIALS = "NoCredentials" - """NO_CREDENTIALS.""" - - -class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type.""" - - AZURE_BLOB = "AzureBlob" - """AZURE_BLOB.""" - AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" - """AZURE_DATA_LAKE_GEN1.""" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - """AZURE_DATA_LAKE_GEN2.""" - AZURE_FILE = "AzureFile" - """AZURE_FILE.""" - ONE_LAKE = "OneLake" - """ONE_LAKE.""" - - -class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data.""" - - URI_FILE = "uri_file" - """URI_FILE.""" - URI_FOLDER = "uri_folder" - """URI_FOLDER.""" - MLTABLE = "mltable" - """MLTABLE.""" - - -class DefaultActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of DefaultActionType.""" - - DENY = "Deny" - """DENY.""" - ALLOW = "Allow" - """ALLOW.""" - - -class DefaultResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of DefaultResourceProvisioningState.""" - - NOT_STARTED = "NotStarted" - """NOT_STARTED.""" - FAILED = "Failed" - """FAILED.""" - CREATING = "Creating" - """CREATING.""" - UPDATING = "Updating" - """UPDATING.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - DELETING = "Deleting" - """DELETING.""" - ACCEPTED = "Accepted" - """ACCEPTED.""" - CANCELED = "Canceled" - """CANCELED.""" - SCALING = "Scaling" - """SCALING.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class DeploymentModelVersionUpgradeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Deployment model version upgrade option.""" - - ONCE_NEW_DEFAULT_VERSION_AVAILABLE = "OnceNewDefaultVersionAvailable" - """ONCE_NEW_DEFAULT_VERSION_AVAILABLE.""" - ONCE_CURRENT_VERSION_EXPIRED = "OnceCurrentVersionExpired" - """ONCE_CURRENT_VERSION_EXPIRED.""" - NO_AUTO_UPGRADE = "NoAutoUpgrade" - """NO_AUTO_UPGRADE.""" - - -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState.""" - - CREATING = "Creating" - """CREATING.""" - DELETING = "Deleting" - """DELETING.""" - SCALING = "Scaling" - """SCALING.""" - UPDATING = "Updating" - """UPDATING.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - CANCELED = "Canceled" - """CANCELED.""" - - -class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error.""" - - WARNING = "Warning" - """WARNING.""" - ERROR = "Error" - """ERROR.""" - INFORMATION = "Information" - """INFORMATION.""" - - -class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type.""" - - PY_TORCH = "PyTorch" - """PY_TORCH.""" - TENSOR_FLOW = "TensorFlow" - """TENSOR_FLOW.""" - MPI = "Mpi" - """MPI.""" - - -class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of EarlyTerminationPolicyType.""" - - BANDIT = "Bandit" - """BANDIT.""" - MEDIAN_STOPPING = "MedianStopping" - """MEDIAN_STOPPING.""" - TRUNCATION_SELECTION = "TruncationSelection" - """TRUNCATION_SELECTION.""" - - -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. - """ - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class EmailNotificationEnableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the email notification type.""" - - JOB_COMPLETED = "JobCompleted" - """JOB_COMPLETED.""" - JOB_FAILED = "JobFailed" - """JOB_FAILED.""" - JOB_CANCELLED = "JobCancelled" - """JOB_CANCELLED.""" - - -class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode.""" - - AML_TOKEN = "AMLToken" - """AML_TOKEN.""" - KEY = "Key" - """KEY.""" - AAD_TOKEN = "AADToken" - """AAD_TOKEN.""" - - -class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type.""" - - MANAGED = "Managed" - """MANAGED.""" - KUBERNETES = "Kubernetes" - """KUBERNETES.""" - AZURE_ML_COMPUTE = "AzureMLCompute" - """AZURE_ML_COMPUTE.""" - - -class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning.""" - - CREATING = "Creating" - """CREATING.""" - DELETING = "Deleting" - """DELETING.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - UPDATING = "Updating" - """UPDATING.""" - CANCELED = "Canceled" - """CANCELED.""" - - -class EndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Connection status of the service consumer with the service provider.""" - - APPROVED = "Approved" - """APPROVED.""" - PENDING = "Pending" - """PENDING.""" - REJECTED = "Rejected" - """REJECTED.""" - DISCONNECTED = "Disconnected" - """DISCONNECTED.""" - TIMEOUT = "Timeout" - """TIMEOUT.""" - - -class EndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the endpoint.""" - - AZURE_OPEN_AI = "Azure.OpenAI" - """AZURE_OPEN_AI.""" - AZURE_SPEECH = "Azure.Speech" - """AZURE_SPEECH.""" - AZURE_CONTENT_SAFETY = "Azure.ContentSafety" - """AZURE_CONTENT_SAFETY.""" - AZURE_LLAMA = "Azure.Llama" - """AZURE_LLAMA.""" - MANAGED_ONLINE_ENDPOINT = "managedOnlineEndpoint" - """MANAGED_ONLINE_ENDPOINT.""" - SERVERLESS_ENDPOINT = "serverlessEndpoint" - """SERVERLESS_ENDPOINT.""" - - -class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service.""" - - CURATED = "Curated" - """CURATED.""" - USER_CREATED = "UserCreated" - """USER_CREATED.""" - - -class EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable.""" - - LOCAL = "local" - """LOCAL.""" - - -class FeatureAttributionMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of FeatureAttributionMetric.""" - - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" - """The Normalized Discounted Cumulative Gain metric.""" - - -class FeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of FeatureDataType.""" - - STRING = "String" - """STRING.""" - INTEGER = "Integer" - """INTEGER.""" - LONG = "Long" - """LONG.""" - FLOAT = "Float" - """FLOAT.""" - DOUBLE = "Double" - """DOUBLE.""" - BINARY = "Binary" - """BINARY.""" - DATETIME = "Datetime" - """DATETIME.""" - BOOLEAN = "Boolean" - """BOOLEAN.""" - - -class FeatureImportanceMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The mode of operation for computing feature importance.""" - - DISABLED = "Disabled" - """Disables computing feature importance within a signal.""" - ENABLED = "Enabled" - """Enables computing feature importance within a signal.""" - - -class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features.""" - - NONE = "None" - """No feature lags generated.""" - AUTO = "Auto" - """System auto-generates feature lags.""" - - -class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode.""" - - AUTO = "Auto" - """Auto mode, system performs featurization without any custom featurization inputs.""" - CUSTOM = "Custom" - """Custom featurization.""" - OFF = "Off" - """Featurization off. 'Forecasting' task cannot use this value.""" - - -class FineTuningTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of FineTuningTaskType.""" - - CHAT_COMPLETION = "ChatCompletion" - """CHAT_COMPLETION.""" - TEXT_COMPLETION = "TextCompletion" - """TEXT_COMPLETION.""" - TEXT_CLASSIFICATION = "TextClassification" - """TEXT_CLASSIFICATION.""" - QUESTION_ANSWERING = "QuestionAnswering" - """QUESTION_ANSWERING.""" - TEXT_SUMMARIZATION = "TextSummarization" - """TEXT_SUMMARIZATION.""" - TOKEN_CLASSIFICATION = "TokenClassification" - """TOKEN_CLASSIFICATION.""" - TEXT_TRANSLATION = "TextTranslation" - """TEXT_TRANSLATION.""" - IMAGE_CLASSIFICATION = "ImageClassification" - """IMAGE_CLASSIFICATION.""" - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - """IMAGE_INSTANCE_SEGMENTATION.""" - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - """IMAGE_OBJECT_DETECTION.""" - VIDEO_MULTI_OBJECT_TRACKING = "VideoMultiObjectTracking" - """VIDEO_MULTI_OBJECT_TRACKING.""" - - -class FirewallSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Firewall Sku used for FQDN Rules.""" - - STANDARD = "Standard" - """STANDARD.""" - BASIC = "Basic" - """BASIC.""" - - -class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode.""" - - AUTO = "Auto" - """Forecast horizon to be determined automatically.""" - CUSTOM = "Custom" - """Use the custom forecast horizon.""" - - -class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML.""" - - AUTO_ARIMA = "AutoArima" - """Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and - statistical analysis to interpret the data and make future predictions. This model aims to - explain data by using time series data on its past values and uses linear regression to make - predictions.""" - PROPHET = "Prophet" - """Prophet is a procedure for forecasting time series data based on an additive model where - non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It - works best with time series that have strong seasonal effects and several seasons of historical - data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers - well.""" - NAIVE = "Naive" - """The Naive forecasting model makes predictions by carrying forward the latest target value for - each time-series in the training data.""" - SEASONAL_NAIVE = "SeasonalNaive" - """The Seasonal Naive forecasting model makes predictions by carrying forward the latest season of - target values for each time-series in the training data.""" - AVERAGE = "Average" - """The Average forecasting model makes predictions by carrying forward the average of the target - values for each time-series in the training data.""" - SEASONAL_AVERAGE = "SeasonalAverage" - """The Seasonal Average forecasting model makes predictions by carrying forward the average value - of the latest season of data for each time-series in the training data.""" - EXPONENTIAL_SMOOTHING = "ExponentialSmoothing" - """Exponential smoothing is a time series forecasting method for univariate data that can be - extended to support data with a systematic trend or seasonal component.""" - ARIMAX = "Arimax" - """An Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) model can be - viewed as a multiple regression model with one or more autoregressive (AR) terms and/or one or - more moving average (MA) terms. This method is suitable for forecasting when data is - stationary/non stationary, and multivariate with any type of data pattern, i.e., level/trend - /seasonality/cyclicity.""" - TCN_FORECASTER = "TCNForecaster" - """TCNForecaster: Temporal Convolutional Networks Forecaster. //TODO: Ask forecasting team for - brief intro.""" - ELASTIC_NET = "ElasticNet" - """Elastic net is a popular type of regularized linear regression that combines two popular - penalties, specifically the L1 and L2 penalty functions.""" - GRADIENT_BOOSTING = "GradientBoosting" - """The technique of transiting week learners into a strong learner is called Boosting. The - gradient boosting algorithm process works on this theory of execution.""" - DECISION_TREE = "DecisionTree" - """Decision Trees are a non-parametric supervised learning method used for both classification and - regression tasks. The goal is to create a model that predicts the value of a target variable by - learning simple decision rules inferred from the data features.""" - KNN = "KNN" - """K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - datapoints which further means that the new data point will be assigned a value based on how - closely it matches the points in the training set.""" - LASSO_LARS = "LassoLars" - """Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - L1 prior as regularizer.""" - SGD = "SGD" - """SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - applications to find the model parameters that correspond to the best fit between predicted and - actual outputs. It's an inexact but powerful technique.""" - RANDOM_FOREST = "RandomForest" - """Random forest is a supervised learning algorithm. The "forest" it builds, is an ensemble of - decision trees, usually trained with the "bagging" method. The general idea of the bagging - method is that a combination of learning models increases the overall result.""" - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - """Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - decision trees. It is related to the widely used random forest algorithm.""" - LIGHT_GBM = "LightGBM" - """LightGBM is a gradient boosting framework that uses tree based learning algorithms.""" - XG_BOOST_REGRESSOR = "XGBoostRegressor" - """XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - using ensemble of base learners.""" - - -class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task.""" - - SPEARMAN_CORRELATION = "SpearmanCorrelation" - """The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation.""" - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - """The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - models with different scales.""" - R2_SCORE = "R2Score" - """The R2 score is one of the performance evaluation measures for forecasting-based machine - learning models.""" - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - """The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - Error (MAE) of (time) series with different scales.""" - - -class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning.""" - - MINIMIZE = "Minimize" - """MINIMIZE.""" - MAXIMIZE = "Maximize" - """MAXIMIZE.""" - - -class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework.""" - - MANAGED = "Managed" - """MANAGED.""" - AML_TOKEN = "AMLToken" - """AML_TOKEN.""" - USER_IDENTITY = "UserIdentity" - """USER_IDENTITY.""" - - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - Environment images (custom and curated). - """ - - DOCKER = "docker" - """DOCKER.""" - AZUREML = "azureml" - """AZUREML.""" - - -class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode.""" - - READ_ONLY_MOUNT = "ReadOnlyMount" - """READ_ONLY_MOUNT.""" - READ_WRITE_MOUNT = "ReadWriteMount" - """READ_WRITE_MOUNT.""" - DOWNLOAD = "Download" - """DOWNLOAD.""" - DIRECT = "Direct" - """DIRECT.""" - EVAL_MOUNT = "EvalMount" - """EVAL_MOUNT.""" - EVAL_DOWNLOAD = "EvalDownload" - """EVAL_DOWNLOAD.""" - - -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks.""" - - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - """Mean Average Precision (MAP) is the average of AP (Average Precision). AP is calculated for - each class and averaged to get the MAP.""" - - -class IsolationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Isolation mode for the managed network of a machine learning workspace.""" - - DISABLED = "Disabled" - """DISABLED.""" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - """ALLOW_INTERNET_OUTBOUND.""" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - """ALLOW_ONLY_APPROVED_OUTBOUND.""" - - -class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type.""" - - LITERAL = "literal" - """LITERAL.""" - URI_FILE = "uri_file" - """URI_FILE.""" - URI_FOLDER = "uri_folder" - """URI_FOLDER.""" - MLTABLE = "mltable" - """MLTABLE.""" - CUSTOM_MODEL = "custom_model" - """CUSTOM_MODEL.""" - MLFLOW_MODEL = "mlflow_model" - """MLFLOW_MODEL.""" - TRITON_MODEL = "triton_model" - """TRITON_MODEL.""" - - -class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of JobLimitsType.""" - - COMMAND = "Command" - """COMMAND.""" - SWEEP = "Sweep" - """SWEEP.""" - - -class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type.""" - - URI_FILE = "uri_file" - """URI_FILE.""" - URI_FOLDER = "uri_folder" - """URI_FOLDER.""" - MLTABLE = "mltable" - """MLTABLE.""" - CUSTOM_MODEL = "custom_model" - """CUSTOM_MODEL.""" - MLFLOW_MODEL = "mlflow_model" - """MLFLOW_MODEL.""" - TRITON_MODEL = "triton_model" - """TRITON_MODEL.""" - - -class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job.""" - - NOT_STARTED = "NotStarted" - """Run hasn't started yet.""" - STARTING = "Starting" - """Run has started. The user has a run ID.""" - PROVISIONING = "Provisioning" - """(Not used currently) It will be used if ES is creating the compute target.""" - PREPARING = "Preparing" - """The run environment is being prepared.""" - QUEUED = "Queued" - """The job is queued in the compute target. For example, in BatchAI the job is in queued state, - while waiting for all required nodes to be ready.""" - RUNNING = "Running" - """The job started to run in the compute target.""" - FINALIZING = "Finalizing" - """Job is completed in the target. It is in output collection state now.""" - CANCEL_REQUESTED = "CancelRequested" - """Cancellation has been requested for the job.""" - COMPLETED = "Completed" - """Job completed successfully. This reflects that both the job itself and output collection states - completed successfully.""" - FAILED = "Failed" - """Job failed.""" - CANCELED = "Canceled" - """Following cancellation request, the job is now successfully canceled.""" - NOT_RESPONDING = "NotResponding" - """When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run - goes to NotResponding state. NotResponding is the only state that is exempt from strict - transition orders. A run can go from NotResponding to any of the previous states.""" - PAUSED = "Paused" - """The job is paused by users. Some adjustment to labeling jobs can be made only in paused state.""" - UNKNOWN = "Unknown" - """Default job status if not mapped to all other statuses.""" - - -class JobTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job tier.""" - - NULL = "Null" - """NULL.""" - SPOT = "Spot" - """SPOT.""" - BASIC = "Basic" - """BASIC.""" - STANDARD = "Standard" - """STANDARD.""" - PREMIUM = "Premium" - """PREMIUM.""" - - -class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job.""" - - AUTO_ML = "AutoML" - """AUTO_ML.""" - COMMAND = "Command" - """COMMAND.""" - SWEEP = "Sweep" - """SWEEP.""" - PIPELINE = "Pipeline" - """PIPELINE.""" - SPARK = "Spark" - """SPARK.""" - FINE_TUNING = "FineTuning" - """FINE_TUNING.""" - DISTILLATION = "Distillation" - """DISTILLATION.""" - - -class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of KeyType.""" - - PRIMARY = "Primary" - """PRIMARY.""" - SECONDARY = "Secondary" - """SECONDARY.""" - - -class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum.""" - - NONE = "None" - """No learning rate scheduler selected.""" - WARMUP_COSINE = "WarmupCosine" - """Cosine Annealing With Warmup.""" - STEP = "Step" - """Step learning rate scheduler.""" - - -class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ListViewType.""" - - ACTIVE_ONLY = "ActiveOnly" - """ACTIVE_ONLY.""" - ARCHIVED_ONLY = "ArchivedOnly" - """ARCHIVED_ONLY.""" - ALL = "All" - """ALL.""" - - -class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type.""" - - PUBLIC_IP = "PublicIp" - """PUBLIC_IP.""" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - """INTERNAL_LOAD_BALANCER.""" - - -class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity.""" - - NOT_SET = "NotSet" - """No logs emitted.""" - DEBUG = "Debug" - """Debug and above log statements logged.""" - INFO = "Info" - """Info and above log statements logged.""" - WARNING = "Warning" - """Warning and above log statements logged.""" - ERROR = "Error" - """Error and above log statements logged.""" - CRITICAL = "Critical" - """Only critical statements logged.""" - - -class ManagedNetworkKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, - but cannot switch back to V1 once V2 is enabled. - """ - - V1 = "V1" - """V1.""" - V2 = "V2" - """V2.""" - - -class ManagedNetworkProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ManagedNetworkProvisioningState.""" - - DEFERRED = "Deferred" - """DEFERRED.""" - UPDATING = "Updating" - """UPDATING.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - DELETING = "Deleting" - """DELETING.""" - DELETED = "Deleted" - """DELETED.""" - - -class ManagedNetworkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status for the managed network of a machine learning workspace.""" - - INACTIVE = "Inactive" - """INACTIVE.""" - ACTIVE = "Active" - """ACTIVE.""" - - -class ManagedPERequirement(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ManagedPERequirement.""" - - REQUIRED = "Required" - """REQUIRED.""" - NOT_REQUIRED = "NotRequired" - """NOT_REQUIRED.""" - NOT_APPLICABLE = "NotApplicable" - """NOT_APPLICABLE.""" - - -class ManagedPEStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ManagedPEStatus.""" - - INACTIVE = "Inactive" - """INACTIVE.""" - ACTIVE = "Active" - """ACTIVE.""" - NOT_APPLICABLE = "NotApplicable" - """NOT_APPLICABLE.""" - - -class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - """No managed identity.""" - SYSTEM_ASSIGNED = "SystemAssigned" - """System assigned managed identity.""" - USER_ASSIGNED = "UserAssigned" - """User assigned managed identity.""" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - """System and user assigned managed identity.""" - - -class MarketplaceSubscriptionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MarketplaceSubscriptionProvisioningState.""" - - CREATING = "Creating" - """MarketplaceSubscription is being created.""" - DELETING = "Deleting" - """MarketplaceSubscription is being deleted.""" - SUCCEEDED = "Succeeded" - """MarketplaceSubscription is successfully provisioned.""" - FAILED = "Failed" - """MarketplaceSubscription provisioning failed.""" - UPDATING = "Updating" - """MarketplaceSubscription is being updated.""" - CANCELED = "Canceled" - """CANCELED.""" - - -class MarketplaceSubscriptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MarketplaceSubscriptionStatus.""" - - SUBSCRIBED = "Subscribed" - """The customer can now use the Marketplace Subscription's model and will be billed.""" - SUSPENDED = "Suspended" - """The customer could not be billed for the Marketplace Subscription. The customer will not be - able to access the model.""" - UNSUBSCRIBED = "Unsubscribed" - """Marketplace Subscriptions reach this state in response to an explicit customer or CSP action. A - Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, - after being in the Suspended state for some time.""" - - -class MaterializationStoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MaterializationStoreType.""" - - NONE = "None" - """NONE.""" - ONLINE = "Online" - """ONLINE.""" - OFFLINE = "Offline" - """OFFLINE.""" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - """ONLINE_AND_OFFLINE.""" - - -class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class ModelLifecycleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Model lifecycle status.""" - - GENERALLY_AVAILABLE = "GenerallyAvailable" - """GENERALLY_AVAILABLE.""" - PREVIEW = "Preview" - """PREVIEW.""" - - -class ModelProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of fine tuning.""" - - AZURE_OPEN_AI = "AzureOpenAI" - """Fine tuning using Azure Open AI model.""" - CUSTOM = "Custom" - """Fine tuning using custom model.""" - - -class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size.""" - - NONE = "None" - """No value selected.""" - SMALL = "Small" - """Small size.""" - MEDIUM = "Medium" - """Medium size.""" - LARGE = "Large" - """Large size.""" - EXTRA_LARGE = "ExtraLarge" - """Extra large size.""" - - -class ModelTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Model task type enum.""" - - CLASSIFICATION = "Classification" - """CLASSIFICATION.""" - REGRESSION = "Regression" - """REGRESSION.""" - - -class MonitorComputeIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Monitor compute identity type enum.""" - - AML_TOKEN = "AmlToken" - """Authenticates through user's AML token.""" - MANAGED_IDENTITY = "ManagedIdentity" - """Authenticates through a user-provided managed identity.""" - - -class MonitorComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Monitor compute type enum.""" - - SERVERLESS_SPARK = "ServerlessSpark" - """Serverless Spark compute.""" - - -class MonitoringFeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MonitoringFeatureDataType.""" - - NUMERICAL = "Numerical" - """Used for features of numerical data type.""" - CATEGORICAL = "Categorical" - """Used for features of categorical data type.""" - - -class MonitoringFeatureFilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MonitoringFeatureFilterType.""" - - ALL_FEATURES = "AllFeatures" - """Includes all features.""" - TOP_N_BY_ATTRIBUTION = "TopNByAttribution" - """Only includes the top contributing features, measured by feature attribution.""" - FEATURE_SUBSET = "FeatureSubset" - """Includes a user-defined subset of features.""" - - -class MonitoringInputDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Monitoring input data type enum.""" - - STATIC = "Static" - """An input data with a fixed window size.""" - ROLLING = "Rolling" - """An input data which rolls relatively to the monitor's current run time.""" - FIXED = "Fixed" - """An input data with tabular format which doesn't require preprocessing.""" - - -class MonitoringNotificationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MonitoringNotificationType.""" - - AML_NOTIFICATION = "AmlNotification" - """Enables email notifications through AML notifications.""" - - -class MonitoringSignalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MonitoringSignalType.""" - - DATA_DRIFT = "DataDrift" - """Tracks model input data distribution change, comparing against training data or past production - data.""" - PREDICTION_DRIFT = "PredictionDrift" - """Tracks prediction result data distribution change, comparing against validation/test label data - or past production data.""" - DATA_QUALITY = "DataQuality" - """Tracks model input data integrity.""" - FEATURE_ATTRIBUTION_DRIFT = "FeatureAttributionDrift" - """Tracks feature importance change in production, comparing against feature importance at - training time.""" - CUSTOM = "Custom" - """Tracks a custom signal provided by users.""" - - -class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action.""" - - MOUNT = "Mount" - """MOUNT.""" - UNMOUNT = "Unmount" - """UNMOUNT.""" - - -class MountMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Mode.""" - - READ_ONLY = "ReadOnly" - """READ_ONLY.""" - READ_WRITE = "ReadWrite" - """READ_WRITE.""" - - -class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state.""" - - MOUNT_REQUESTED = "MountRequested" - """MOUNT_REQUESTED.""" - MOUNTED = "Mounted" - """MOUNTED.""" - MOUNT_FAILED = "MountFailed" - """MOUNT_FAILED.""" - UNMOUNT_REQUESTED = "UnmountRequested" - """UNMOUNT_REQUESTED.""" - UNMOUNT_FAILED = "UnmountFailed" - """UNMOUNT_FAILED.""" - UNMOUNTED = "Unmounted" - """UNMOUNTED.""" - - -class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined.""" - - AUTO = "Auto" - """Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML - task.""" - CUSTOM = "Custom" - """Use custom N-Cross validations value.""" - - -class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container.""" - - BRIDGE = "Bridge" - """BRIDGE.""" - HOST = "Host" - """HOST.""" - - -class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - """IDLE.""" - RUNNING = "running" - """RUNNING.""" - PREPARING = "preparing" - """PREPARING.""" - UNUSABLE = "unusable" - """UNUSABLE.""" - LEAVING = "leaving" - """LEAVING.""" - PREEMPTED = "preempted" - """PREEMPTED.""" - - -class NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value.""" - - ALL = "All" - """ALL.""" - - -class NumericalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of NumericalDataDriftMetric.""" - - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - """The Jensen Shannon Distance (JSD) metric.""" - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - """The Population Stability Index (PSI) metric.""" - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - """The Normalized Wasserstein Distance metric.""" - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - """The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric.""" - - -class NumericalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of NumericalDataQualityMetric.""" - - NULL_VALUE_RATE = "NullValueRate" - """Calculates the rate of null values.""" - DATA_TYPE_ERROR_RATE = "DataTypeErrorRate" - """Calculates the rate of data type errors.""" - OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" - """Calculates the rate values are out of bounds.""" - - -class NumericalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of NumericalPredictionDriftMetric.""" - - JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" - """The Jensen Shannon Distance (JSD) metric.""" - POPULATION_STABILITY_INDEX = "PopulationStabilityIndex" - """The Population Stability Index (PSI) metric.""" - NORMALIZED_WASSERSTEIN_DISTANCE = "NormalizedWassersteinDistance" - """The Normalized Wasserstein Distance metric.""" - TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" - """The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric.""" - - -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task.""" - - MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" - """Mean Average Precision (MAP) is the average of AP (Average Precision). AP is calculated for - each class and averaged to get the MAP.""" - - -class OneLakeArtifactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine OneLake artifact type.""" - - LAKE_HOUSE = "LakeHouse" - """LAKE_HOUSE.""" - - -class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system.""" - - LINUX = "Linux" - """LINUX.""" - WINDOWS = "Windows" - """WINDOWS.""" - - -class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation.""" - - CREATE = "Create" - """CREATE.""" - START = "Start" - """START.""" - STOP = "Stop" - """STOP.""" - RESTART = "Restart" - """RESTART.""" - RESIZE = "Resize" - """RESIZE.""" - REIMAGE = "Reimage" - """REIMAGE.""" - DELETE = "Delete" - """DELETE.""" - - -class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status.""" - - IN_PROGRESS = "InProgress" - """IN_PROGRESS.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - CREATE_FAILED = "CreateFailed" - """CREATE_FAILED.""" - START_FAILED = "StartFailed" - """START_FAILED.""" - STOP_FAILED = "StopFailed" - """STOP_FAILED.""" - RESTART_FAILED = "RestartFailed" - """RESTART_FAILED.""" - RESIZE_FAILED = "ResizeFailed" - """RESIZE_FAILED.""" - REIMAGE_FAILED = "ReimageFailed" - """REIMAGE_FAILED.""" - DELETE_FAILED = "DeleteFailed" - """DELETE_FAILED.""" - - -class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation.""" - - USER = "User" - """USER.""" - SCHEDULE = "Schedule" - """SCHEDULE.""" - IDLE_SHUTDOWN = "IdleShutdown" - """IDLE_SHUTDOWN.""" - - -class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of OrderString.""" - - CREATED_AT_DESC = "CreatedAtDesc" - """CREATED_AT_DESC.""" - CREATED_AT_ASC = "CreatedAtAsc" - """CREATED_AT_ASC.""" - UPDATED_AT_DESC = "UpdatedAtDesc" - """UPDATED_AT_DESC.""" - UPDATED_AT_ASC = "UpdatedAtAsc" - """UPDATED_AT_ASC.""" - - -class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". - """ - - USER = "user" - """Indicates the operation is initiated by a user.""" - SYSTEM = "system" - """Indicates the operation is initiated by a system.""" - USER_SYSTEM = "user,system" - """Indicates the operation is initiated by a user or system.""" - - -class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type.""" - - LINUX = "Linux" - """LINUX.""" - WINDOWS = "Windows" - """WINDOWS.""" - - -class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums.""" - - READ_WRITE_MOUNT = "ReadWriteMount" - """READ_WRITE_MOUNT.""" - UPLOAD = "Upload" - """UPLOAD.""" - DIRECT = "Direct" - """DIRECT.""" - - -class PatchStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The os patching status.""" - - COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" - """COMPLETED_WITH_WARNINGS.""" - FAILED = "Failed" - """FAILED.""" - IN_PROGRESS = "InProgress" - """IN_PROGRESS.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - UNKNOWN = "Unknown" - """UNKNOWN.""" - - -class PendingUploadCredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the PendingUpload credentials type.""" - - SAS = "SAS" - """SAS.""" - - -class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of storage to use for the pending upload location.""" - - NONE = "None" - """NONE.""" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - """TEMPORARY_BLOB_REFERENCE.""" - - -class PoolProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of pool related resources provisioning.""" - - CREATING = "Creating" - """CREATING.""" - DELETING = "Deleting" - """DELETING.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - UPDATING = "Updating" - """UPDATING.""" - CANCELED = "Canceled" - """CANCELED.""" - - -class PrivateEndpointConnectionProvisioningState( # pylint: disable=name-too-long - str, Enum, metaclass=CaseInsensitiveEnumMeta -): - """The current provisioning state.""" - - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - CREATING = "Creating" - """CREATING.""" - DELETING = "Deleting" - """DELETING.""" - FAILED = "Failed" - """FAILED.""" - - -class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint.""" - - TCP = "tcp" - """TCP.""" - UDP = "udp" - """UDP.""" - HTTP = "http" - """HTTP.""" - - -class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, - Succeeded, and Failed. - """ - - UNKNOWN = "Unknown" - """UNKNOWN.""" - UPDATING = "Updating" - """UPDATING.""" - CREATING = "Creating" - """CREATING.""" - DELETING = "Deleting" - """DELETING.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - CANCELED = "Canceled" - """CANCELED.""" - - -class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule.""" - - COMPLETED = "Completed" - """COMPLETED.""" - PROVISIONING = "Provisioning" - """PROVISIONING.""" - FAILED = "Failed" - """FAILED.""" - - -class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement.""" - - COUNT = "Count" - """COUNT.""" - - -class RaiPolicyContentSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Content source to apply the Content Filters.""" - - PROMPT = "Prompt" - """PROMPT.""" - COMPLETION = "Completion" - """COMPLETION.""" - - -class RaiPolicyMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Content Filters mode.""" - - DEFAULT = "Default" - """DEFAULT.""" - DEFERRED = "Deferred" - """DEFERRED.""" - BLOCKING = "Blocking" - """BLOCKING.""" - - -class RaiPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Content Filters policy type.""" - - USER_MANAGED = "UserManaged" - """USER_MANAGED.""" - SYSTEM_MANAGED = "SystemManaged" - """SYSTEM_MANAGED.""" - - -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm.""" - - RANDOM = "Random" - """RANDOM.""" - SOBOL = "Sobol" - """SOBOL.""" - - -class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule.""" - - MINUTE = "Minute" - """Minute frequency.""" - HOUR = "Hour" - """Hour frequency.""" - DAY = "Day" - """Day frequency.""" - WEEK = "Week" - """Week frequency.""" - MONTH = "Month" - """Month frequency.""" - - -class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset.""" - - ID = "Id" - """ID.""" - DATA_PATH = "DataPath" - """DATA_PATH.""" - OUTPUT_PATH = "OutputPath" - """OUTPUT_PATH.""" - - -class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML.""" - - ELASTIC_NET = "ElasticNet" - """Elastic net is a popular type of regularized linear regression that combines two popular - penalties, specifically the L1 and L2 penalty functions.""" - GRADIENT_BOOSTING = "GradientBoosting" - """The technique of transiting week learners into a strong learner is called Boosting. The - gradient boosting algorithm process works on this theory of execution.""" - DECISION_TREE = "DecisionTree" - """Decision Trees are a non-parametric supervised learning method used for both classification and - regression tasks. The goal is to create a model that predicts the value of a target variable by - learning simple decision rules inferred from the data features.""" - KNN = "KNN" - """K-nearest neighbors (KNN) algorithm uses 'feature similarity' to predict the values of new - datapoints which further means that the new data point will be assigned a value based on how - closely it matches the points in the training set.""" - LASSO_LARS = "LassoLars" - """Lasso model fit with Least Angle Regression a.k.a. Lars. It is a Linear Model trained with an - L1 prior as regularizer.""" - SGD = "SGD" - """SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning - applications to find the model parameters that correspond to the best fit between predicted and - actual outputs. It's an inexact but powerful technique.""" - RANDOM_FOREST = "RandomForest" - """Random forest is a supervised learning algorithm. The "forest" it builds, is an ensemble of - decision trees, usually trained with the "bagging" method. The general idea of the bagging - method is that a combination of learning models increases the overall result.""" - EXTREME_RANDOM_TREES = "ExtremeRandomTrees" - """Extreme Trees is an ensemble machine learning algorithm that combines the predictions from many - decision trees. It is related to the widely used random forest algorithm.""" - LIGHT_GBM = "LightGBM" - """LightGBM is a gradient boosting framework that uses tree based learning algorithms.""" - XG_BOOST_REGRESSOR = "XGBoostRegressor" - """XGBoostRegressor: Extreme Gradient Boosting Regressor is a supervised machine learning model - using ensemble of base learners.""" - - -class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task.""" - - SPEARMAN_CORRELATION = "SpearmanCorrelation" - """The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation.""" - NORMALIZED_ROOT_MEAN_SQUARED_ERROR = "NormalizedRootMeanSquaredError" - """The Normalized Root Mean Squared Error (NRMSE) the RMSE facilitates the comparison between - models with different scales.""" - R2_SCORE = "R2Score" - """The R2 score is one of the performance evaluation measures for forecasting-based machine - learning models.""" - NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" - """The Normalized Mean Absolute Error (NMAE) is a validation metric to compare the Mean Absolute - Error (MAE) of (time) series with different scales.""" - - -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - NOT_SPECIFIED = "NotSpecified" - """NOT_SPECIFIED.""" - - -class RollingRateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RollingRateType.""" - - YEAR = "Year" - """YEAR.""" - MONTH = "Month" - """MONTH.""" - DAY = "Day" - """DAY.""" - HOUR = "Hour" - """HOUR.""" - MINUTE = "Minute" - """MINUTE.""" - - -class RuleAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The action enum for networking rule.""" - - ALLOW = "Allow" - """ALLOW.""" - DENY = "Deny" - """DENY.""" - - -class RuleCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of a managed network Outbound Rule of a machine learning workspace.""" - - REQUIRED = "Required" - """REQUIRED.""" - RECOMMENDED = "Recommended" - """RECOMMENDED.""" - USER_DEFINED = "UserDefined" - """USER_DEFINED.""" - DEPENDENCY = "Dependency" - """DEPENDENCY.""" - - -class RuleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of a managed network Outbound Rule of a machine learning workspace.""" - - INACTIVE = "Inactive" - """INACTIVE.""" - ACTIVE = "Active" - """ACTIVE.""" - PROVISIONING = "Provisioning" - """PROVISIONING.""" - DELETING = "Deleting" - """DELETING.""" - FAILED = "Failed" - """FAILED.""" - - -class RuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of a managed network Outbound Rule of a machine learning workspace.""" - - FQDN = "FQDN" - """FQDN.""" - PRIVATE_ENDPOINT = "PrivateEndpoint" - """PRIVATE_ENDPOINT.""" - SERVICE_TAG = "ServiceTag" - """SERVICE_TAG.""" - - -class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of SamplingAlgorithmType.""" - - GRID = "Grid" - """GRID.""" - RANDOM = "Random" - """RANDOM.""" - BAYESIAN = "Bayesian" - """BAYESIAN.""" - - -class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ScaleType.""" - - DEFAULT = "Default" - """DEFAULT.""" - TARGET_UTILIZATION = "TargetUtilization" - """TARGET_UTILIZATION.""" - - -class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ScheduleActionType.""" - - CREATE_JOB = "CreateJob" - """CREATE_JOB.""" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - """INVOKE_BATCH_ENDPOINT.""" - CREATE_MONITOR = "CreateMonitor" - """CREATE_MONITOR.""" - - -class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ScheduleListViewType.""" - - ENABLED_ONLY = "EnabledOnly" - """ENABLED_ONLY.""" - DISABLED_ONLY = "DisabledOnly" - """DISABLED_ONLY.""" - ALL = "All" - """ALL.""" - - -class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule.""" - - COMPLETED = "Completed" - """COMPLETED.""" - PROVISIONING = "Provisioning" - """PROVISIONING.""" - FAILED = "Failed" - """FAILED.""" - - -class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ScheduleProvisioningStatus.""" - - CREATING = "Creating" - """CREATING.""" - UPDATING = "Updating" - """UPDATING.""" - DELETING = "Deleting" - """DELETING.""" - SUCCEEDED = "Succeeded" - """SUCCEEDED.""" - FAILED = "Failed" - """FAILED.""" - CANCELED = "Canceled" - """CANCELED.""" - - -class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled?.""" - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode.""" - - AUTO = "Auto" - """Seasonality to be determined automatically.""" - CUSTOM = "Custom" - """Use the custom seasonality value.""" - - -class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type.""" - - ACCOUNT_KEY = "AccountKey" - """ACCOUNT_KEY.""" - CERTIFICATE = "Certificate" - """CERTIFICATE.""" - SAS = "Sas" - """SAS.""" - SERVICE_PRINCIPAL = "ServicePrincipal" - """SERVICE_PRINCIPAL.""" - - -class ServerlessEndpointState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the Serverless Endpoint.""" - - UNKNOWN = "Unknown" - """UNKNOWN.""" - CREATING = "Creating" - """CREATING.""" - DELETING = "Deleting" - """DELETING.""" - SUSPENDING = "Suspending" - """SUSPENDING.""" - REINSTATING = "Reinstating" - """REINSTATING.""" - ONLINE = "Online" - """ONLINE.""" - SUSPENDED = "Suspended" - """SUSPENDED.""" - CREATION_FAILED = "CreationFailed" - """CREATION_FAILED.""" - DELETION_FAILED = "DeletionFailed" - """DELETION_FAILED.""" - - -class ServerlessInferenceEndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ServerlessInferenceEndpointAuthMode.""" - - KEY = "Key" - """KEY.""" - AAD = "AAD" - """AAD.""" - KEY_AND_AAD = "KeyAndAAD" - """KEY_AND_AAD.""" - - -class ServiceAccountKeyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ServiceAccountKeyName.""" - - KEY1 = "Key1" - """KEY1.""" - KEY2 = "Key2" - """KEY2.""" - - -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ServiceDataAccessAuthIdentity.""" - - NONE = "None" - """Do not use any identity for service data access.""" - WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" - """Use the system assigned managed identity of the Workspace to authenticate service data access.""" - WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" - """Use the user assigned managed identity of the Workspace to authenticate service data access.""" - - -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series.""" - - NONE = "None" - """Represents no/null value.""" - AUTO = "Auto" - """Short series will be padded if there are no long series, otherwise short series will be - dropped.""" - PAD = "Pad" - """All the short series will be padded.""" - DROP = "Drop" - """All the short series will be dropped.""" - - -class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku.""" - - AUTOMATIC = "Automatic" - """Automatically scales node count.""" - MANUAL = "Manual" - """Node count scaled upon user request.""" - NONE = "None" - """Fixed set of nodes.""" - - -class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - """The Free service tier.""" - BASIC = "Basic" - """The Basic service tier.""" - STANDARD = "Standard" - """The Standard service tier.""" - PREMIUM = "Premium" - """The Premium service tier.""" - - -class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type.""" - - DATASET = "Dataset" - """DATASET.""" - DATASTORE = "Datastore" - """DATASTORE.""" - URI = "URI" - """URI.""" - - -class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of SparkJobEntryType.""" - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - """SPARK_JOB_PYTHON_ENTRY.""" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - """SPARK_JOB_SCALA_ENTRY.""" - - -class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - """ENABLED.""" - DISABLED = "Disabled" - """DISABLED.""" - - -class SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring.""" - - DISABLED = "Disabled" - """DISABLED.""" - ENABLED = "Enabled" - """ENABLED.""" - AUTO = "Auto" - """AUTO.""" - - -class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The meta-learner is a model trained on the output of the individual heterogeneous models. - Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV - if cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or - ElasticNetCV if cross-validation is enabled). This parameter can be one of the following - strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, - ElasticNetCV, LightGBMRegressor, or LinearRegression. - """ - - NONE = "None" - """NONE.""" - LOGISTIC_REGRESSION = "LogisticRegression" - """Default meta-learners are LogisticRegression for classification tasks.""" - LOGISTIC_REGRESSION_CV = "LogisticRegressionCV" - """Default meta-learners are LogisticRegression for classification task when CV is on.""" - LIGHT_GBM_CLASSIFIER = "LightGBMClassifier" - """LIGHT_GBM_CLASSIFIER.""" - ELASTIC_NET = "ElasticNet" - """Default meta-learners are LogisticRegression for regression task.""" - ELASTIC_NET_CV = "ElasticNetCV" - """Default meta-learners are LogisticRegression for regression task when CV is on.""" - LIGHT_GBM_REGRESSOR = "LightGBMRegressor" - """LIGHT_GBM_REGRESSOR.""" - LINEAR_REGRESSION = "LinearRegression" - """LINEAR_REGRESSION.""" - - -class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota.""" - - UNDEFINED = "Undefined" - """UNDEFINED.""" - SUCCESS = "Success" - """SUCCESS.""" - FAILURE = "Failure" - """FAILURE.""" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - """INVALID_QUOTA_BELOW_CLUSTER_MINIMUM.""" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - """INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT.""" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - """INVALID_VM_FAMILY_NAME.""" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - """OPERATION_NOT_SUPPORTED_FOR_SKU.""" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - """OPERATION_NOT_ENABLED_FOR_REGION.""" - - -class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models.""" - - NONE = "None" - """No optimizer selected.""" - SGD = "Sgd" - """Stochastic Gradient Descent optimizer.""" - ADAM = "Adam" - """Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of - moments.""" - ADAMW = "Adamw" - """AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay.""" - - -class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account.""" - - STANDARD_LRS = "Standard_LRS" - """STANDARD_LRS.""" - PREMIUM_LRS = "Premium_LRS" - """PREMIUM_LRS.""" - - -class SystemDatastoresAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The auth mode used for accessing the system datastores of the workspace.""" - - ACCESS_KEY = "AccessKey" - """ACCESS_KEY.""" - IDENTITY = "Identity" - """IDENTITY.""" - USER_DELEGATION_SAS = "UserDelegationSAS" - """USER_DELEGATION_SAS.""" - - -class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function.""" - - NONE = "None" - """Represent no value set.""" - SUM = "Sum" - """SUM.""" - MAX = "Max" - """MAX.""" - MIN = "Min" - """MIN.""" - MEAN = "Mean" - """MEAN.""" - - -class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes.""" - - AUTO = "Auto" - """Target lags to be determined automatically.""" - CUSTOM = "Custom" - """Use the custom target lags.""" - - -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode.""" - - AUTO = "Auto" - """Determine rolling windows size automatically.""" - CUSTOM = "Custom" - """Use the specified rolling window size.""" - - -class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type.""" - - CLASSIFICATION = "Classification" - """Classification in machine learning and statistics is a supervised learning approach in which - the computer program learns from the data given to it and make new observations or - classifications.""" - REGRESSION = "Regression" - """Regression means to predict the value using the input data. Regression models are used to - predict a continuous value.""" - FORECASTING = "Forecasting" - """Forecasting is a special kind of regression task that deals with time-series data and creates - forecasting model that can be used to predict the near future values based on the inputs.""" - IMAGE_CLASSIFICATION = "ImageClassification" - """Image Classification. Multi-class image classification is used when an image is classified with - only a single label from a set of classes - e.g. each image is classified as either an image of - a 'cat' or a 'dog' or a 'duck'.""" - IMAGE_CLASSIFICATION_MULTILABEL = "ImageClassificationMultilabel" - """Image Classification Multilabel. Multi-label image classification is used when an image could - have one or more labels from a set of labels - e.g. an image could be labeled with both 'cat' - and 'dog'.""" - IMAGE_OBJECT_DETECTION = "ImageObjectDetection" - """Image Object Detection. Object detection is used to identify objects in an image and locate - each object with a bounding box e.g. locate all dogs and cats in an image and draw a bounding - box around each.""" - IMAGE_INSTANCE_SEGMENTATION = "ImageInstanceSegmentation" - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - the pixel level, drawing a polygon around each object in the image.""" - TEXT_CLASSIFICATION = "TextClassification" - """Text classification (also known as text tagging or text categorization) is the process of - sorting texts into categories. Categories are mutually exclusive.""" - TEXT_CLASSIFICATION_MULTILABEL = "TextClassificationMultilabel" - """Multilabel classification task assigns each sample to a group (zero or more) of target labels.""" - TEXT_NER = "TextNER" - """Text Named Entity Recognition a.k.a. TextNER. Named Entity Recognition (NER) is the ability to - take free-form text and identify the occurrences of entities such as people, locations, - organizations, and more.""" - - -class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of TriggerType.""" - - RECURRENCE = "Recurrence" - """RECURRENCE.""" - CRON = "Cron" - """CRON.""" - - -class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of UnderlyingResourceAction.""" - - DELETE = "Delete" - """DELETE.""" - DETACH = "Detach" - """DETACH.""" - - -class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour.""" - - ONE_HOUR = "OneHour" - """ONE_HOUR.""" - - -class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement.""" - - COUNT = "Count" - """COUNT.""" - - -class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column.""" - - NONE = "None" - """No stl decomposition.""" - SEASON = "Season" - """SEASON.""" - SEASON_TREND = "SeasonTrend" - """SEASON_TREND.""" - - -class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks.""" - - NONE = "None" - """No metric.""" - COCO = "Coco" - """Coco metric.""" - VOC = "Voc" - """Voc metric.""" - COCO_VOC = "CocoVoc" - """CocoVoc metric.""" - - -class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM.""" - - LINUX = "Linux" - """LINUX.""" - WINDOWS = "Windows" - """WINDOWS.""" - - -class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority.""" - - DEDICATED = "Dedicated" - """DEDICATED.""" - LOW_PRIORITY = "LowPriority" - """LOW_PRIORITY.""" - - -class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM.""" - - STANDARD = "Standard" - """STANDARD.""" - LOW_PRIORITY = "LowPriority" - """LOW_PRIORITY.""" - SPOT = "Spot" - """SPOT.""" - - -class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe.""" - - BIND = "bind" - """BIND.""" - VOLUME = "volume" - """VOLUME.""" - TMPFS = "tmpfs" - """TMPFS.""" - NPIPE = "npipe" - """NPIPE.""" - - -class VulnerabilityRisk(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of VulnerabilityRisk.""" - - UNKNOWN = "UNKNOWN" - """UNKNOWN.""" - CRITICAL = "CRITICAL" - """CRITICAL.""" - HIGH = "HIGH" - """HIGH.""" - MEDIUM = "MEDIUM" - """MEDIUM.""" - LOW = "LOW" - """LOW.""" - - -class WebhookType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the webhook callback service type.""" - - AZURE_DEV_OPS = "AzureDevOps" - """AZURE_DEV_OPS.""" - - -class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday.""" - - MONDAY = "Monday" - """Monday weekday.""" - TUESDAY = "Tuesday" - """Tuesday weekday.""" - WEDNESDAY = "Wednesday" - """Wednesday weekday.""" - THURSDAY = "Thursday" - """Thursday weekday.""" - FRIDAY = "Friday" - """Friday weekday.""" - SATURDAY = "Saturday" - """Saturday weekday.""" - SUNDAY = "Sunday" - """Sunday weekday.""" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_models.py deleted file mode 100644 index d39754468a04..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_models.py +++ /dev/null @@ -1,30353 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -import datetime -from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload - -from .._utils.model_base import Model as _Model, rest_discriminator, rest_field -from ._enums import ( - BatchDeploymentConfigurationType, - ComputeType, - ConnectionAuthType, - CredentialsType, - DataGenerationType, - DataReferenceCredentialType, - DataType, - DatastoreType, - DistributionType, - EarlyTerminationPolicyType, - EndpointComputeType, - EndpointType, - ForecastHorizonMode, - IdentityConfigurationType, - JobInputType, - JobLimitsType, - JobOutputType, - JobType, - ModelProvider, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringSignalType, - NCrossValidationsMode, - NodesValueType, - OneLakeArtifactType, - PendingUploadCredentialType, - ReferenceType, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - SeasonalityMode, - SecretsType, - SparkJobEntryType, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TriggerType, - WebhookType, -) - -if TYPE_CHECKING: - from .. import models as _models - - -class WorkspaceConnectionPropertiesV2(_Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AADAuthTypeWorkspaceConnectionProperties, AccessKeyAuthTypeWorkspaceConnectionProperties, - AccountKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, - CustomKeysWorkspaceConnectionProperties, ManagedIdentityAuthTypeWorkspaceConnectionProperties, - NoneAuthTypeWorkspaceConnectionProperties, OAuth2AuthTypeWorkspaceConnectionProperties, - PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, - ServicePrincipalAuthTypeWorkspaceConnectionProperties, - UsernamePasswordAuthTypeWorkspaceConnectionProperties - - :ivar auth_type: Authentication type of the connection target. Required. Known values are: - "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", "AccountKey", "ServicePrincipal", - "AccessKey", "ApiKey", "CustomKeys", "OAuth2", "AAD", "DelegatedSAS", "ProjectManagedIdentity", - "AccountManagedIdentity", "UserEntraToken", "AgentUserImpersonation", "AgenticIdentityToken", - and "AgenticUser". - :vartype auth_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionAuthType - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - """ - - __mapping__: dict[str, _Model] = {} - auth_type: str = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) - """Authentication type of the connection target. Required. Known values are: \"PAT\", - \"ManagedIdentity\", \"UsernamePassword\", \"None\", \"SAS\", \"AccountKey\", - \"ServicePrincipal\", \"AccessKey\", \"ApiKey\", \"CustomKeys\", \"OAuth2\", \"AAD\", - \"DelegatedSAS\", \"ProjectManagedIdentity\", \"AccountManagedIdentity\", \"UserEntraToken\", - \"AgentUserImpersonation\", \"AgenticIdentityToken\", and \"AgenticUser\".""" - category: Optional[Union[str, "_models.ConnectionCategory"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Category of the connection. Known values are: \"PythonFeed\", \"ContainerRegistry\", \"Git\", - \"S3\", \"Snowflake\", \"AzureKeyVault\", \"AzureSqlDb\", \"AzureSynapseAnalytics\", - \"AzureMySqlDb\", \"AzurePostgresDb\", \"ADLSGen2\", \"AzureContainerAppEnvironment\", - \"Redis\", \"ApiKey\", \"AzureOpenAI\", \"AIServices\", \"CognitiveSearch\", - \"CognitiveService\", \"CustomKeys\", \"AzureBlob\", \"AzureStorageAccount\", \"AzureOneLake\", - \"CosmosDb\", \"CosmosDbMongoDbApi\", \"AzureDataExplorer\", \"AzureMariaDb\", - \"AzureDatabricksDeltaLake\", \"AzureSqlMi\", \"AzureTableStorage\", \"AmazonRdsForOracle\", - \"AmazonRdsForSqlServer\", \"AmazonRedshift\", \"Db2\", \"Drill\", \"GoogleBigQuery\", - \"Greenplum\", \"Hbase\", \"Hive\", \"Impala\", \"Informix\", \"MariaDb\", \"MicrosoftAccess\", - \"MySql\", \"Netezza\", \"Oracle\", \"Phoenix\", \"PostgreSql\", \"Presto\", \"SapOpenHub\", - \"SapBw\", \"SapHana\", \"SapTable\", \"Spark\", \"SqlServer\", \"Sybase\", \"Teradata\", - \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", - \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", - \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", - \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", - \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", - \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", - \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", - \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", - \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", - \"Serp\", \"BingLLMSearch\", \"Serverless\", \"ManagedOnlineEndpoint\", \"ApiManagement\", - \"ModelGateway\", \"GroundingWithBingSearch\", \"GroundingWithCustomSearch\", \"Sharepoint\", - \"MicrosoftFabric\", \"PowerPlatformEnvironment\", and \"RemoteA2A\".""" - created_by_workspace_arm_id: Optional[str] = rest_field(name="createdByWorkspaceArmId", visibility=["read"]) - error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - expiry_time: Optional[datetime.datetime] = rest_field( - name="expiryTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - group: Optional[Union[str, "_models.ConnectionGroup"]] = rest_field(visibility=["read"]) - """Group based on connection category. Known values are: \"Azure\", \"AzureAI\", \"Database\", - \"NoSQL\", \"File\", \"GenericProtocol\", and \"ServicesAndApps\".""" - is_shared_to_all: Optional[bool] = rest_field( - name="isSharedToAll", visibility=["read", "create", "update", "delete", "query"] - ) - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Store user metadata for this connection.""" - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = rest_field( - name="peRequirement", visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"Required\", \"NotRequired\", and \"NotApplicable\".""" - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = rest_field( - name="peStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"Inactive\", \"Active\", and \"NotApplicable\".""" - shared_user_list: Optional[list[str]] = rest_field( - name="sharedUserList", visibility=["read", "create", "update", "delete", "query"] - ) - target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - use_workspace_managed_identity: Optional[bool] = rest_field( - name="useWorkspaceManagedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - auth_type: str, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AADAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2, discriminator="AAD"): - """This connection type covers the AAD auth for any applicable Azure service. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar auth_type: Authentication type of the connection target. Required. AAD. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AAD - """ - - auth_type: Literal[ConnectionAuthType.AAD] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. AAD.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.AAD # type: ignore - - -class AccessKeyAuthTypeWorkspaceConnectionProperties( - WorkspaceConnectionPropertiesV2, discriminator="AccessKey" -): # pylint: disable=name-too-long - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionAccessKey - :ivar auth_type: Authentication type of the connection target. Required. ACCESS_KEY. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ACCESS_KEY - """ - - credentials: Optional["_models.WorkspaceConnectionAccessKey"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.ACCESS_KEY] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. ACCESS_KEY.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionAccessKey"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.ACCESS_KEY # type: ignore - - -class AccountApiKeys(_Model): - """AccountApiKeys. - - :ivar key1: - :vartype key1: str - :ivar key2: - :vartype key2: str - """ - - key1: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - key2: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - key1: Optional[str] = None, - key2: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AccountKeyAuthTypeWorkspaceConnectionProperties( - WorkspaceConnectionPropertiesV2, discriminator="AccountKey" -): # pylint: disable=name-too-long - """This connection type covers the account key connection for Azure storage. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Account key object for workspace connection credential. - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionAccountKey - :ivar auth_type: Authentication type of the connection target. Required. ACCOUNT_KEY. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ACCOUNT_KEY - """ - - credentials: Optional["_models.WorkspaceConnectionAccountKey"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Account key object for workspace connection credential.""" - auth_type: Literal[ConnectionAuthType.ACCOUNT_KEY] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. ACCOUNT_KEY.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionAccountKey"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.ACCOUNT_KEY # type: ignore - - -class DatastoreCredentials(_Model): - """Base definition for datastore credentials. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AccountKeyDatastoreCredentials, CertificateDatastoreCredentials, NoneDatastoreCredentials, - SasDatastoreCredentials, ServicePrincipalDatastoreCredentials - - :ivar credentials_type: [Required] Credential type used to authentication with storage. - Required. Known values are: "AccountKey", "Certificate", "None", "Sas", and "ServicePrincipal". - :vartype credentials_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CredentialsType - """ - - __mapping__: dict[str, _Model] = {} - credentials_type: str = rest_discriminator( - name="credentialsType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Credential type used to authentication with storage. Required. Known values are: - \"AccountKey\", \"Certificate\", \"None\", \"Sas\", and \"ServicePrincipal\".""" - - @overload - def __init__( - self, - *, - credentials_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AccountKeyDatastoreCredentials(DatastoreCredentials, discriminator="AccountKey"): - """Account key datastore credentials configuration. - - :ivar secrets: [Required] Storage account secrets. Required. - :vartype secrets: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountKeyDatastoreSecrets - :ivar credentials_type: [Required] Credential type used to authentication with storage. - Required. ACCOUNT_KEY. - :vartype credentials_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ACCOUNT_KEY - """ - - secrets: "_models.AccountKeyDatastoreSecrets" = rest_field(visibility=["create", "update"]) - """[Required] Storage account secrets. Required.""" - credentials_type: Literal[CredentialsType.ACCOUNT_KEY] = rest_discriminator(name="credentialsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. ACCOUNT_KEY.""" - - @overload - def __init__( - self, - *, - secrets: "_models.AccountKeyDatastoreSecrets", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credentials_type = CredentialsType.ACCOUNT_KEY # type: ignore - - -class DatastoreSecrets(_Model): - """Base definition for datastore secrets. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AccountKeyDatastoreSecrets, CertificateDatastoreSecrets, SasDatastoreSecrets, - ServicePrincipalDatastoreSecrets - - :ivar secrets_type: [Required] Credential type used to authentication with storage. Required. - Known values are: "AccountKey", "Certificate", "Sas", and "ServicePrincipal". - :vartype secrets_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SecretsType - """ - - __mapping__: dict[str, _Model] = {} - secrets_type: str = rest_discriminator( - name="secretsType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Credential type used to authentication with storage. Required. Known values are: - \"AccountKey\", \"Certificate\", \"Sas\", and \"ServicePrincipal\".""" - - @overload - def __init__( - self, - *, - secrets_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AccountKeyDatastoreSecrets(DatastoreSecrets, discriminator="AccountKey"): - """Datastore account key secrets. - - :ivar key: Storage account key. - :vartype key: str - :ivar secrets_type: [Required] Credential type used to authentication with storage. Required. - ACCOUNT_KEY. - :vartype secrets_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ACCOUNT_KEY - """ - - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Storage account key.""" - secrets_type: Literal[SecretsType.ACCOUNT_KEY] = rest_discriminator(name="secretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. ACCOUNT_KEY.""" - - @overload - def __init__( - self, - *, - key: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.secrets_type = SecretsType.ACCOUNT_KEY # type: ignore - - -class AcrDetails(_Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: Details of system created ACR account to be used for the - Registry. - :vartype system_created_acr_account: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemCreatedAcrAccount - """ - - system_created_acr_account: Optional["_models.SystemCreatedAcrAccount"] = rest_field( - name="systemCreatedAcrAccount", visibility=["read", "create", "update", "delete", "query"] - ) - """Details of system created ACR account to be used for the Registry.""" - - @overload - def __init__( - self, - *, - system_created_acr_account: Optional["_models.SystemCreatedAcrAccount"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ActualCapacityInfo(_Model): - """ActualCapacityInfo. - - :ivar total: Gets or sets the total number of instances (scale units) regardless of - provisioning state or whether current group payload version matches the target group payload. - :vartype total: int - :ivar succeeded: Gets or sets the number of instances (scale units) which have Succeeded - provisioning state and target group payload. - :vartype succeeded: int - :ivar failed: Gets or sets the number of instances (scale units) which have Failed provisioning - state and have target group payload. - :vartype failed: int - :ivar outdated_succeeded: Gets or sets the number of instances (scale units) which have - Succeeded provisioning state but do not have target group payload. - :vartype outdated_succeeded: int - :ivar outdated_failed: Gets or sets the number of instances (scale units) which have Failed - provisioning state but do not have target group payload. - :vartype outdated_failed: int - """ - - total: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the total number of instances (scale units) regardless of provisioning state or - whether current group payload version matches the target group payload.""" - succeeded: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the number of instances (scale units) which have Succeeded provisioning state and - target group payload.""" - failed: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the number of instances (scale units) which have Failed provisioning state and - have target group payload.""" - outdated_succeeded: Optional[int] = rest_field( - name="outdatedSucceeded", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the number of instances (scale units) which have Succeeded provisioning state but - do not have target group payload.""" - outdated_failed: Optional[int] = rest_field( - name="outdatedFailed", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the number of instances (scale units) which have Failed provisioning state but do - not have target group payload.""" - - @overload - def __init__( - self, - *, - total: Optional[int] = None, - succeeded: Optional[int] = None, - failed: Optional[int] = None, - outdated_succeeded: Optional[int] = None, - outdated_failed: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Compute(_Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, - Kubernetes, SynapseSpark, VirtualMachine - - :ivar compute_type: The type of compute. Required. Known values are: "AKS", "Kubernetes", - "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", - "DataLakeAnalytics", and "SynapseSpark". - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - __mapping__: dict[str, _Model] = {} - compute_type: str = rest_discriminator( - name="computeType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of compute. Required. Known values are: \"AKS\", \"Kubernetes\", \"AmlCompute\", - \"ComputeInstance\", \"DataFactory\", \"VirtualMachine\", \"HDInsight\", \"Databricks\", - \"DataLakeAnalytics\", and \"SynapseSpark\".""" - compute_location: Optional[str] = rest_field(name="computeLocation", visibility=["read", "create"]) - """Location for the underlying compute.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, - Succeeded, and Failed. Known values are: \"Unknown\", \"Updating\", \"Creating\", \"Deleting\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the Machine Learning compute.""" - created_on: Optional[datetime.datetime] = rest_field(name="createdOn", visibility=["read"], format="rfc3339") - """The time at which the compute was created.""" - modified_on: Optional[datetime.datetime] = rest_field(name="modifiedOn", visibility=["read"], format="rfc3339") - """The time at which the compute was last modified.""" - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM resource id of the underlying compute.""" - provisioning_errors: Optional[list["_models.ErrorResponse"]] = rest_field( - name="provisioningErrors", visibility=["read"] - ) - """Errors during provisioning.""" - is_attached_compute: Optional[bool] = rest_field(name="isAttachedCompute", visibility=["read"]) - """Indicating whether the compute was provisioned by user and brought from outside if true, or - machine learning service provisioned it if false.""" - disable_local_auth: Optional[bool] = rest_field(name="disableLocalAuth", visibility=["read", "create"]) - """Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for - authentication.""" - - @overload - def __init__( - self, - *, - compute_type: str, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AKS(Compute, discriminator="AKS"): - """A Machine Learning compute based on AKS. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: AKS properties. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AKSSchemaProperties - :ivar compute_type: The type of compute. Required. AKS. - :vartype compute_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AKS - """ - - properties: Optional["_models.AKSSchemaProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """AKS properties.""" - compute_type: Literal[ComputeType.AKS] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. AKS.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.AKSSchemaProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.AKS # type: ignore - - -class ComputeSecrets(_Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets - - :ivar compute_type: The type of compute. Required. Known values are: "AKS", "Kubernetes", - "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", - "DataLakeAnalytics", and "SynapseSpark". - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeType - """ - - __mapping__: dict[str, _Model] = {} - compute_type: str = rest_discriminator( - name="computeType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of compute. Required. Known values are: \"AKS\", \"Kubernetes\", \"AmlCompute\", - \"ComputeInstance\", \"DataFactory\", \"VirtualMachine\", \"HDInsight\", \"Databricks\", - \"DataLakeAnalytics\", and \"SynapseSpark\".""" - - @overload - def __init__( - self, - *, - compute_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AksComputeSecrets(ComputeSecrets, discriminator="AKS"): - """Secrets related to a Machine Learning compute based on AKS. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: The type of compute. Required. AKS. - :vartype compute_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AKS - """ - - user_kube_config: Optional[str] = rest_field( - name="userKubeConfig", visibility=["read", "create", "update", "delete", "query"] - ) - """Content of kubeconfig file that can be used to connect to the Kubernetes cluster.""" - admin_kube_config: Optional[str] = rest_field( - name="adminKubeConfig", visibility=["read", "create", "update", "delete", "query"] - ) - """Content of kubeconfig file that can be used to connect to the Kubernetes cluster.""" - image_pull_secret_name: Optional[str] = rest_field( - name="imagePullSecretName", visibility=["read", "create", "update", "delete", "query"] - ) - """Image registry pull secret.""" - compute_type: Literal[ComputeType.AKS] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. AKS.""" - - @overload - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.AKS # type: ignore - - -class AksNetworkingConfiguration(_Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - subnet_id: Optional[str] = rest_field(name="subnetId", visibility=["read", "create", "update", "delete", "query"]) - """Virtual network subnet resource ID the compute nodes belong to.""" - service_cidr: Optional[str] = rest_field( - name="serviceCidr", visibility=["read", "create", "update", "delete", "query"] - ) - """A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any - Subnet IP ranges.""" - dns_service_ip: Optional[str] = rest_field( - name="dnsServiceIP", visibility=["read", "create", "update", "delete", "query"] - ) - """An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service - address range specified in serviceCidr.""" - docker_bridge_cidr: Optional[str] = rest_field( - name="dockerBridgeCidr", visibility=["read", "create", "update", "delete", "query"] - ) - """A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any - Subnet IP ranges or the Kubernetes service address range.""" - - @overload - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AKSSchemaProperties(_Model): - """AKS properties. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Known values are: "FastProd", - "DenseProd", and "DevTest". - :vartype cluster_purpose: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Known values are: "PublicIp" and - "InternalLoadBalancer". - :vartype load_balancer_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - cluster_fqdn: Optional[str] = rest_field( - name="clusterFqdn", visibility=["read", "create", "update", "delete", "query"] - ) - """Cluster full qualified domain name.""" - system_services: Optional[list["_models.SystemService"]] = rest_field(name="systemServices", visibility=["read"]) - """System services.""" - agent_count: Optional[int] = rest_field( - name="agentCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of agents.""" - agent_vm_size: Optional[str] = rest_field( - name="agentVmSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Agent virtual machine size.""" - cluster_purpose: Optional[Union[str, "_models.ClusterPurpose"]] = rest_field( - name="clusterPurpose", visibility=["read", "create", "update", "delete", "query"] - ) - """Intended usage of the cluster. Known values are: \"FastProd\", \"DenseProd\", and \"DevTest\".""" - ssl_configuration: Optional["_models.SslConfiguration"] = rest_field( - name="sslConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """SSL configuration.""" - aks_networking_configuration: Optional["_models.AksNetworkingConfiguration"] = rest_field( - name="aksNetworkingConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """AKS networking configuration for vnet.""" - load_balancer_type: Optional[Union[str, "_models.LoadBalancerType"]] = rest_field( - name="loadBalancerType", visibility=["read", "create", "update", "delete", "query"] - ) - """Load Balancer Type. Known values are: \"PublicIp\" and \"InternalLoadBalancer\".""" - load_balancer_subnet: Optional[str] = rest_field( - name="loadBalancerSubnet", visibility=["read", "create", "update", "delete", "query"] - ) - """Load Balancer Subnet.""" - - @overload - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "_models.ClusterPurpose"]] = None, - ssl_configuration: Optional["_models.SslConfiguration"] = None, - aks_networking_configuration: Optional["_models.AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "_models.LoadBalancerType"]] = None, - load_balancer_subnet: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitoringFeatureFilterBase(_Model): - """MonitoringFeatureFilterBase. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AllFeatures, FeatureSubset, TopNFeaturesByAttribution - - :ivar filter_type: [Required] Specifies the feature filter to leverage when selecting features - to calculate metrics over. Required. Known values are: "AllFeatures", "TopNByAttribution", and - "FeatureSubset". - :vartype filter_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureFilterType - """ - - __mapping__: dict[str, _Model] = {} - filter_type: str = rest_discriminator(name="filterType", visibility=["read", "create"]) - """[Required] Specifies the feature filter to leverage when selecting features to calculate - metrics over. Required. Known values are: \"AllFeatures\", \"TopNByAttribution\", and - \"FeatureSubset\".""" - - @overload - def __init__( - self, - *, - filter_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AllFeatures(MonitoringFeatureFilterBase, discriminator="AllFeatures"): - """AllFeatures. - - :ivar filter_type: [Required] Specifies the feature filter to leverage when selecting features - to calculate metrics over. Required. Includes all features. - :vartype filter_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ALL_FEATURES - """ - - filter_type: Literal[MonitoringFeatureFilterType.ALL_FEATURES] = rest_discriminator(name="filterType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the feature filter to leverage when selecting features to calculate - metrics over. Required. Includes all features.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.filter_type = MonitoringFeatureFilterType.ALL_FEATURES # type: ignore - - -class Nodes(_Model): - """Abstract Nodes definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AllNodes - - :ivar nodes_value_type: [Required] Type of the Nodes value. Required. "All" - :vartype nodes_value_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NodesValueType - """ - - __mapping__: dict[str, _Model] = {} - nodes_value_type: str = rest_discriminator(name="nodesValueType", visibility=["read", "create"]) - """[Required] Type of the Nodes value. Required. \"All\"""" - - @overload - def __init__( - self, - *, - nodes_value_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AllNodes(Nodes, discriminator="All"): - """All nodes means the service will be running on all of the nodes of the job. - - :ivar nodes_value_type: [Required] Type of the Nodes value. Required. ALL. - :vartype nodes_value_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ALL - """ - - nodes_value_type: Literal[NodesValueType.ALL] = rest_discriminator(name="nodesValueType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Type of the Nodes value. Required. ALL.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.nodes_value_type = NodesValueType.ALL # type: ignore - - -class AmlCompute(Compute, discriminator="AmlCompute"): - """An Azure Machine Learning compute. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of AmlCompute. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AmlComputeProperties - :ivar compute_type: The type of compute. Required. AML_COMPUTE. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AML_COMPUTE - """ - - properties: Optional["_models.AmlComputeProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of AmlCompute.""" - compute_type: Literal[ComputeType.AML_COMPUTE] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. AML_COMPUTE.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.AmlComputeProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.AML_COMPUTE # type: ignore - - -class AmlComputeNodeInformation(_Model): - """Compute node information related to a AmlCompute. - - :ivar node_id: Node ID. - :vartype node_id: str - :ivar private_ip_address: Private IP address. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar port: Port. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Known values are: "idle", "running", "preparing", "unusable", "leaving", - and "preempted". - :vartype node_state: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NodeState - :ivar run_id: Run ID. - :vartype run_id: str - """ - - node_id: Optional[str] = rest_field(name="nodeId", visibility=["read"]) - """Node ID.""" - private_ip_address: Optional[str] = rest_field(name="privateIpAddress", visibility=["read"]) - """Private IP address.""" - public_ip_address: Optional[str] = rest_field(name="publicIpAddress", visibility=["read"]) - """Public IP address.""" - port: Optional[int] = rest_field(visibility=["read"]) - """Port.""" - node_state: Optional[Union[str, "_models.NodeState"]] = rest_field(name="nodeState", visibility=["read"]) - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. Known values are: \"idle\", \"running\", \"preparing\", \"unusable\", \"leaving\", - and \"preempted\".""" - run_id: Optional[str] = rest_field(name="runId", visibility=["read"]) - """Run ID.""" - - -class AmlComputeProperties(_Model): - """AML Compute properties. - - :ivar os_type: Compute OS Type. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Known values are: "Dedicated" and "LowPriority". - :vartype vm_priority: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScaleSettings - :ivar user_account_credentials: User account credentials. - :vartype user_account_credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UserAccountCredentials - :ivar subnet: Subnet. - :vartype subnet: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResourceId - :ivar remote_login_port_public_access: Close remote Login Access Port. Known values are: - "Enabled", "Disabled", and "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state. Known values are: "Steady" and "Resizing". - :vartype allocation_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AllocationState - :ivar allocation_state_transition_time: Allocation state transition time. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Errors. - :vartype errors: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar current_node_count: Current node count. - :vartype current_node_count: int - :ivar target_node_count: Target node count. - :vartype target_node_count: int - :ivar node_state_counts: Node state counts. - :vartype node_state_counts: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NodeStateCounts - :ivar enable_node_public_ip: Enable node public IP. - :vartype enable_node_public_ip: bool - :ivar property_bag: A property bag containing additional properties. - :vartype property_bag: any - """ - - os_type: Optional[Union[str, "_models.OsType"]] = rest_field( - name="osType", visibility=["read", "create", "update", "delete", "query"] - ) - """Compute OS Type. Known values are: \"Linux\" and \"Windows\".""" - vm_size: Optional[str] = rest_field(name="vmSize", visibility=["read", "create", "update", "delete", "query"]) - """Virtual Machine Size.""" - vm_priority: Optional[Union[str, "_models.VmPriority"]] = rest_field( - name="vmPriority", visibility=["read", "create", "update", "delete", "query"] - ) - """Virtual Machine priority. Known values are: \"Dedicated\" and \"LowPriority\".""" - virtual_machine_image: Optional["_models.VirtualMachineImage"] = rest_field( - name="virtualMachineImage", visibility=["read", "create", "update", "delete", "query"] - ) - """Virtual Machine image for AML Compute - windows only.""" - isolated_network: Optional[bool] = rest_field( - name="isolatedNetwork", visibility=["read", "create", "update", "delete", "query"] - ) - """Network is isolated or not.""" - scale_settings: Optional["_models.ScaleSettings"] = rest_field( - name="scaleSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Scale settings for AML Compute.""" - user_account_credentials: Optional["_models.UserAccountCredentials"] = rest_field( - name="userAccountCredentials", visibility=["read", "create", "update", "delete", "query"] - ) - """User account credentials.""" - subnet: Optional["_models.ResourceId"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Subnet.""" - remote_login_port_public_access: Optional[Union[str, "_models.RemoteLoginPortPublicAccess"]] = rest_field( - name="remoteLoginPortPublicAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Close remote Login Access Port. Known values are: \"Enabled\", \"Disabled\", and - \"NotSpecified\".""" - allocation_state: Optional[Union[str, "_models.AllocationState"]] = rest_field( - name="allocationState", visibility=["read"] - ) - """Allocation state. Known values are: \"Steady\" and \"Resizing\".""" - allocation_state_transition_time: Optional[datetime.datetime] = rest_field( - name="allocationStateTransitionTime", visibility=["read"], format="rfc3339" - ) - """Allocation state transition time.""" - errors: Optional[list["_models.ErrorResponse"]] = rest_field(visibility=["read"]) - """Errors.""" - current_node_count: Optional[int] = rest_field(name="currentNodeCount", visibility=["read"]) - """Current node count.""" - target_node_count: Optional[int] = rest_field(name="targetNodeCount", visibility=["read"]) - """Target node count.""" - node_state_counts: Optional["_models.NodeStateCounts"] = rest_field(name="nodeStateCounts", visibility=["read"]) - """Node state counts.""" - enable_node_public_ip: Optional[bool] = rest_field( - name="enableNodePublicIp", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable node public IP.""" - property_bag: Optional[Any] = rest_field( - name="propertyBag", visibility=["read", "create", "update", "delete", "query"] - ) - """A property bag containing additional properties.""" - - @overload - def __init__( - self, - *, - os_type: Optional[Union[str, "_models.OsType"]] = None, - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "_models.VmPriority"]] = None, - virtual_machine_image: Optional["_models.VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["_models.ScaleSettings"] = None, - user_account_credentials: Optional["_models.UserAccountCredentials"] = None, - subnet: Optional["_models.ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "_models.RemoteLoginPortPublicAccess"]] = None, - enable_node_public_ip: Optional[bool] = None, - property_bag: Optional[Any] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class IdentityConfiguration(_Model): - """Base definition for identity configuration. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AmlToken, ManagedIdentity, UserIdentity - - :ivar identity_type: [Required] Specifies the type of identity framework. Required. Known - values are: "Managed", "AMLToken", and "UserIdentity". - :vartype identity_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfigurationType - """ - - __mapping__: dict[str, _Model] = {} - identity_type: str = rest_discriminator(name="identityType", visibility=["read", "create"]) - """[Required] Specifies the type of identity framework. Required. Known values are: \"Managed\", - \"AMLToken\", and \"UserIdentity\".""" - - @overload - def __init__( - self, - *, - identity_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AmlToken(IdentityConfiguration, discriminator="AMLToken"): - """AML Token identity configuration. - - :ivar identity_type: [Required] Specifies the type of identity framework. Required. AML_TOKEN. - :vartype identity_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AML_TOKEN - """ - - identity_type: Literal[IdentityConfigurationType.AML_TOKEN] = rest_discriminator(name="identityType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of identity framework. Required. AML_TOKEN.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.identity_type = IdentityConfigurationType.AML_TOKEN # type: ignore - - -class MonitorComputeIdentityBase(_Model): - """Monitor compute identity base definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AmlTokenComputeIdentity, ManagedComputeIdentity - - :ivar compute_identity_type: [Required] Specifies the type of identity to use within the - monitoring jobs. Required. Known values are: "AmlToken" and "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitorComputeIdentityType - """ - - __mapping__: dict[str, _Model] = {} - compute_identity_type: str = rest_discriminator(name="computeIdentityType", visibility=["read", "create"]) - """[Required] Specifies the type of identity to use within the monitoring jobs. Required. Known - values are: \"AmlToken\" and \"ManagedIdentity\".""" - - @overload - def __init__( - self, - *, - compute_identity_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AmlTokenComputeIdentity(MonitorComputeIdentityBase, discriminator="AmlToken"): - """AML token compute identity definition. - - :ivar compute_identity_type: [Required] Specifies the type of identity to use within the - monitoring jobs. Required. Authenticates through user's AML token. - :vartype compute_identity_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AML_TOKEN - """ - - compute_identity_type: Literal[MonitorComputeIdentityType.AML_TOKEN] = rest_discriminator(name="computeIdentityType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of identity to use within the monitoring jobs. Required. - Authenticates through user's AML token.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_identity_type = MonitorComputeIdentityType.AML_TOKEN # type: ignore - - -class AmlUserFeature(_Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the feature ID.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the feature name.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Describes the feature for user experience.""" - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - display_name: Optional[str] = None, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataReferenceCredential(_Model): - """DataReferenceCredential base class. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DockerCredential, ManagedIdentityCredential, AnonymousAccessCredential, SASCredential - - :ivar credential_type: [Required] Credential type used to authentication with storage. - Required. Known values are: "SAS", "DockerCredentials", "ManagedIdentity", and "NoCredentials". - :vartype credential_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataReferenceCredentialType - """ - - __mapping__: dict[str, _Model] = {} - credential_type: str = rest_discriminator( - name="credentialType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Credential type used to authentication with storage. Required. Known values are: - \"SAS\", \"DockerCredentials\", \"ManagedIdentity\", and \"NoCredentials\".""" - - @overload - def __init__( - self, - *, - credential_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AnonymousAccessCredential(DataReferenceCredential, discriminator="NoCredentials"): - """Access credential with no credentials. - - :ivar credential_type: [Required] Credential type used to authentication with storage. - Required. NO_CREDENTIALS. - :vartype credential_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NO_CREDENTIALS - """ - - credential_type: Literal[DataReferenceCredentialType.NO_CREDENTIALS] = rest_discriminator(name="credentialType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. NO_CREDENTIALS.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credential_type = DataReferenceCredentialType.NO_CREDENTIALS # type: ignore - - -class ApiKeyAuthWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2, discriminator="ApiKey"): - """This connection type covers the generic ApiKey auth connection categories, for examples: - AzureOpenAI: - Category:= AzureOpenAI - AuthType:= ApiKey (as type discriminator) - Credentials:= {ApiKey} as - Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {ApiBase} - - CognitiveService: - Category:= CognitiveService - AuthType:= ApiKey (as type discriminator) - Credentials:= {SubscriptionKey} as - Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= ServiceRegion={serviceRegion} - - CognitiveSearch: - Category:= CognitiveSearch - AuthType:= ApiKey (as type discriminator) - Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey - Target:= {Endpoint} - - Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionApiKey - :ivar auth_type: Authentication type of the connection target. Required. API_KEY. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.API_KEY - """ - - credentials: Optional["_models.WorkspaceConnectionApiKey"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.API_KEY] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. API_KEY.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionApiKey"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.API_KEY # type: ignore - - -class ArmResourceId(_Model): - """ARM ResourceId of a resource. - - :ivar resource_id: Arm ResourceId is in the format - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" - or - "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". - :vartype resource_id: str - """ - - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Arm ResourceId is in the format - \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}\" - or - \"/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}\".""" - - @overload - def __init__( - self, - *, - resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ResourceBase(_Model): - """ResourceBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - """ - - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The asset description text.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The asset property dictionary.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Tag dictionary. Tags can be added, removed, and updated.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AssetBase(ResourceBase): - """AssetBase. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - """ - - is_anonymous: Optional[bool] = rest_field(name="isAnonymous", visibility=["read", "create"]) - """If the name version are system generated (anonymous registration).""" - is_archived: Optional[bool] = rest_field(name="isArchived", visibility=["read", "create", "update"]) - """Is the asset archived?.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AssetContainer(ResourceBase): - """AssetContainer. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - """ - - is_archived: Optional[bool] = rest_field(name="isArchived", visibility=["read", "create", "update"]) - """Is the asset archived?.""" - latest_version: Optional[str] = rest_field(name="latestVersion", visibility=["read"]) - """The latest version inside this container.""" - next_version: Optional[str] = rest_field(name="nextVersion", visibility=["read"]) - """The next auto incremental version.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AssetReferenceBase(_Model): - """Base definition for asset references. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataPathAssetReference, IdAssetReference, OutputPathAssetReference - - :ivar reference_type: [Required] Specifies the type of asset reference. Required. Known values - are: "Id", "DataPath", and "OutputPath". - :vartype reference_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ReferenceType - """ - - __mapping__: dict[str, _Model] = {} - reference_type: str = rest_discriminator( - name="referenceType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Specifies the type of asset reference. Required. Known values are: \"Id\", - \"DataPath\", and \"OutputPath\".""" - - @overload - def __init__( - self, - *, - reference_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AssignedUser(_Model): - """A user that can be assigned to a compute instance. - - :ivar object_id: User’s AAD Object Id. Required. - :vartype object_id: str - :ivar tenant_id: User’s AAD Tenant Id. Required. - :vartype tenant_id: str - """ - - object_id: str = rest_field(name="objectId", visibility=["read", "create", "update", "delete", "query"]) - """User’s AAD Object Id. Required.""" - tenant_id: str = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """User’s AAD Tenant Id. Required.""" - - @overload - def __init__( - self, - *, - object_id: str, - tenant_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ForecastHorizon(_Model): - """The desired maximum forecast horizon in units of time-series frequency. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutoForecastHorizon, CustomForecastHorizon - - :ivar mode: [Required] Set forecast horizon value selection mode. Required. Known values are: - "Auto" and "Custom". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ForecastHorizonMode - """ - - __mapping__: dict[str, _Model] = {} - mode: str = rest_discriminator(name="mode", visibility=["read", "create"]) - """[Required] Set forecast horizon value selection mode. Required. Known values are: \"Auto\" and - \"Custom\".""" - - @overload - def __init__( - self, - *, - mode: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AutoForecastHorizon(ForecastHorizon, discriminator="Auto"): - """Forecast horizon determined automatically by system. - - :ivar mode: [Required] Set forecast horizon value selection mode. Required. Forecast horizon to - be determined automatically. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AUTO - """ - - mode: Literal[ForecastHorizonMode.AUTO] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Set forecast horizon value selection mode. Required. Forecast horizon to be - determined automatically.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = ForecastHorizonMode.AUTO # type: ignore - - -class JobBaseProperties(ResourceBase): - """Base definition for a job. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutoMLJob, CommandJob, DistillationJob, FineTuningJob, PipelineJob, SparkJob, SweepJob - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: [Required] Specifies the type of job. Required. Known values are: "AutoML", - "Command", "Sweep", "Pipeline", "Spark", "FineTuning", and "Distillation". - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - """ - - __mapping__: dict[str, _Model] = {} - component_id: Optional[str] = rest_field(name="componentId", visibility=["read", "create"]) - """ARM resource ID of the component resource.""" - compute_id: Optional[str] = rest_field(name="computeId", visibility=["read", "create"]) - """ARM resource ID of the compute resource.""" - display_name: Optional[str] = rest_field(name="displayName", visibility=["read", "create"]) - """Display name of job.""" - experiment_name: Optional[str] = rest_field(name="experimentName", visibility=["read", "create"]) - """The name of the experiment the job belongs to. If not set, the job is placed in the \"Default\" - experiment.""" - identity: Optional["_models.IdentityConfiguration"] = rest_field(visibility=["read", "create"]) - """Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity - or null. Defaults to AmlToken if null.""" - is_archived: Optional[bool] = rest_field(name="isArchived", visibility=["read", "create", "update"]) - """Is the asset archived?.""" - job_type: str = rest_discriminator(name="jobType", visibility=["read", "create"]) - """[Required] Specifies the type of job. Required. Known values are: \"AutoML\", \"Command\", - \"Sweep\", \"Pipeline\", \"Spark\", \"FineTuning\", and \"Distillation\".""" - notification_setting: Optional["_models.NotificationSetting"] = rest_field( - name="notificationSetting", visibility=["read", "create", "update"] - ) - """Notification setting for the job.""" - parent_job_name: Optional[str] = rest_field( - name="parentJobName", visibility=["read", "create", "update", "delete", "query"] - ) - """Parent job name.""" - services: Optional[dict[str, "_models.JobService"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of - FileStreamObject.""" - status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"]) - """Status of the job. Known values are: \"NotStarted\", \"Starting\", \"Provisioning\", - \"Preparing\", \"Queued\", \"Running\", \"Finalizing\", \"CancelRequested\", \"Completed\", - \"Failed\", \"Canceled\", \"NotResponding\", \"Paused\", and \"Unknown\".""" - - @overload - def __init__( - self, - *, - job_type: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AutoMLJob(JobBaseProperties, discriminator="AutoML"): - """AutoMLJob class. Use this class for executing AutoML tasks like Classification/Regression etc. - See TaskType enum for all the tasks supported. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. This is - optional value to provide, if not provided, AutoML will default this to Production AutoML - curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobResourceConfiguration - :ivar task_details: [Required] This represents scenario which can be one of Tables/NLP/Image. - Required. - :vartype task_details: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AutoMLVertical - :ivar job_type: [Required] Specifies the type of job. Required. AUTO_ML. - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AUTO_ML - """ - - environment_id: Optional[str] = rest_field(name="environmentId", visibility=["read", "create"]) - """The ARM resource ID of the Environment specification for the job. This is optional value to - provide, if not provided, AutoML will default this to Production AutoML curated environment - version when running the job.""" - environment_variables: Optional[dict[str, str]] = rest_field( - name="environmentVariables", visibility=["read", "create"] - ) - """Environment variables included in the job.""" - outputs: Optional[dict[str, "_models.JobOutput"]] = rest_field(visibility=["read", "create"]) - """Mapping of output data bindings used in the job.""" - queue_settings: Optional["_models.QueueSettings"] = rest_field(name="queueSettings", visibility=["read", "create"]) - """Queue settings for the job.""" - resources: Optional["_models.JobResourceConfiguration"] = rest_field(visibility=["read", "create"]) - """Compute Resource configuration for the job.""" - task_details: "_models.AutoMLVertical" = rest_field( - name="taskDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] This represents scenario which can be one of Tables/NLP/Image. Required.""" - job_type: Literal[JobType.AUTO_ML] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. AUTO_ML.""" - - @overload - def __init__( - self, - *, - task_details: "_models.AutoMLVertical", - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[dict[str, str]] = None, - outputs: Optional[dict[str, "_models.JobOutput"]] = None, - queue_settings: Optional["_models.QueueSettings"] = None, - resources: Optional["_models.JobResourceConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = JobType.AUTO_ML # type: ignore - - -class AutoMLVertical(_Model): - """AutoML vertical class. Base class for AutoML verticals - - TableVertical/ImageVertical/NLPVertical. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, - ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, - TextClassificationMultilabel, TextNer - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: [Required] Task type for AutoMLJob. Required. Known values are: - "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", and "TextNER". - :vartype task_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TaskType - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - """ - - __mapping__: dict[str, _Model] = {} - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = rest_field( - name="logVerbosity", visibility=["read", "create", "update", "delete", "query"] - ) - """Enum for setting log verbosity. Known values are: \"NotSet\", \"Debug\", \"Info\", \"Warning\", - \"Error\", and \"Critical\".""" - target_column_name: Optional[str] = rest_field( - name="targetColumnName", visibility=["read", "create", "update", "delete", "query"] - ) - """Target column name: This is prediction values column. Also known as label column name in - context of classification tasks.""" - task_type: str = rest_discriminator(name="taskType", visibility=["read", "create"]) - """[Required] Task type for AutoMLJob. Required. Known values are: \"Classification\", - \"Regression\", \"Forecasting\", \"ImageClassification\", \"ImageClassificationMultilabel\", - \"ImageObjectDetection\", \"ImageInstanceSegmentation\", \"TextClassification\", - \"TextClassificationMultilabel\", and \"TextNER\".""" - training_data: "_models.MLTableJobInput" = rest_field( - name="trainingData", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Training data input. Required.""" - - @overload - def __init__( - self, - *, - task_type: str, - training_data: "_models.MLTableJobInput", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NCrossValidations(_Model): - """N-Cross validations value. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutoNCrossValidations, CustomNCrossValidations - - :ivar mode: [Required] Mode for determining N-Cross validations. Required. Known values are: - "Auto" and "Custom". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NCrossValidationsMode - """ - - __mapping__: dict[str, _Model] = {} - mode: str = rest_discriminator(name="mode", visibility=["read", "create"]) - """[Required] Mode for determining N-Cross validations. Required. Known values are: \"Auto\" and - \"Custom\".""" - - @overload - def __init__( - self, - *, - mode: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AutoNCrossValidations(NCrossValidations, discriminator="Auto"): - """N-Cross validations determined automatically. - - :ivar mode: [Required] Mode for determining N-Cross validations. Required. Determine N-Cross - validations value automatically. Supported only for 'Forecasting' AutoML task. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AUTO - """ - - mode: Literal[NCrossValidationsMode.AUTO] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Mode for determining N-Cross validations. Required. Determine N-Cross validations - value automatically. Supported only for 'Forecasting' AutoML task.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = NCrossValidationsMode.AUTO # type: ignore - - -class AutoPauseProperties(_Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - delay_in_minutes: Optional[int] = rest_field( - name="delayInMinutes", visibility=["read", "create", "update", "delete", "query"] - ) - enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AutoScaleProperties(_Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - min_node_count: Optional[int] = rest_field( - name="minNodeCount", visibility=["read", "create", "update", "delete", "query"] - ) - enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - max_node_count: Optional[int] = rest_field( - name="maxNodeCount", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Seasonality(_Model): - """Forecasting seasonality. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutoSeasonality, CustomSeasonality - - :ivar mode: [Required] Seasonality mode. Required. Known values are: "Auto" and "Custom". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SeasonalityMode - """ - - __mapping__: dict[str, _Model] = {} - mode: str = rest_discriminator(name="mode", visibility=["read", "create"]) - """[Required] Seasonality mode. Required. Known values are: \"Auto\" and \"Custom\".""" - - @overload - def __init__( - self, - *, - mode: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AutoSeasonality(Seasonality, discriminator="Auto"): - """AutoSeasonality. - - :ivar mode: [Required] Seasonality mode. Required. Seasonality to be determined automatically. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AUTO - """ - - mode: Literal[SeasonalityMode.AUTO] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Seasonality mode. Required. Seasonality to be determined automatically.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = SeasonalityMode.AUTO # type: ignore - - -class TargetLags(_Model): - """The number of past periods to lag from the target column. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutoTargetLags, CustomTargetLags - - :ivar mode: [Required] Set target lags mode - Auto/Custom. Required. Known values are: "Auto" - and "Custom". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TargetLagsMode - """ - - __mapping__: dict[str, _Model] = {} - mode: str = rest_discriminator(name="mode", visibility=["read", "create"]) - """[Required] Set target lags mode - Auto/Custom. Required. Known values are: \"Auto\" and - \"Custom\".""" - - @overload - def __init__( - self, - *, - mode: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AutoTargetLags(TargetLags, discriminator="Auto"): - """AutoTargetLags. - - :ivar mode: [Required] Set target lags mode - Auto/Custom. Required. Target lags to be - determined automatically. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AUTO - """ - - mode: Literal[TargetLagsMode.AUTO] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Set target lags mode - Auto/Custom. Required. Target lags to be determined - automatically.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = TargetLagsMode.AUTO # type: ignore - - -class TargetRollingWindowSize(_Model): - """Forecasting target rolling window size. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutoTargetRollingWindowSize, CustomTargetRollingWindowSize - - :ivar mode: [Required] TargetRollingWindowSiz detection mode. Required. Known values are: - "Auto" and "Custom". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TargetRollingWindowSizeMode - """ - - __mapping__: dict[str, _Model] = {} - mode: str = rest_discriminator(name="mode", visibility=["read", "create"]) - """[Required] TargetRollingWindowSiz detection mode. Required. Known values are: \"Auto\" and - \"Custom\".""" - - @overload - def __init__( - self, - *, - mode: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AutoTargetRollingWindowSize(TargetRollingWindowSize, discriminator="Auto"): - """Target lags rolling window determined automatically. - - :ivar mode: [Required] TargetRollingWindowSiz detection mode. Required. Determine rolling - windows size automatically. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AUTO - """ - - mode: Literal[TargetRollingWindowSizeMode.AUTO] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] TargetRollingWindowSiz detection mode. Required. Determine rolling windows size - automatically.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = TargetRollingWindowSizeMode.AUTO # type: ignore - - -class AvailableQuota(_Model): - """AvailableQuota. - - :ivar properties: Available quota properties. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AvailableQuotaProperties - """ - - properties: Optional["_models.AvailableQuotaProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Available quota properties.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.AvailableQuotaProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AvailableQuotaProperties(_Model): - """AvailableQuotaProperties. - - :ivar total: The number of available quota. - :vartype total: int - """ - - total: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of available quota.""" - - @overload - def __init__( - self, - *, - total: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DatastoreProperties(ResourceBase): - """Base definition for datastore contents configuration. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureBlobDatastore, AzureDataLakeGen1Datastore, AzureDataLakeGen2Datastore, AzureFileDatastore, - OneLakeDatastore - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: [Required] Account credentials. Required. - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreCredentials - :ivar datastore_type: Enum to determine the datastore contents type. Required. Known values - are: "AzureBlob", "AzureDataLakeGen1", "AzureDataLakeGen2", "AzureFile", and "OneLake". - :vartype datastore_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreType - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - """ - - __mapping__: dict[str, _Model] = {} - credentials: "_models.DatastoreCredentials" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Account credentials. Required.""" - datastore_type: str = rest_discriminator( - name="datastoreType", visibility=["read", "create", "update", "delete", "query"] - ) - """Enum to determine the datastore contents type. Required. Known values are: \"AzureBlob\", - \"AzureDataLakeGen1\", \"AzureDataLakeGen2\", \"AzureFile\", and \"OneLake\".""" - is_default: Optional[bool] = rest_field(name="isDefault", visibility=["read"]) - """Readonly property to indicate if datastore is the workspace default datastore.""" - - @overload - def __init__( - self, - *, - credentials: "_models.DatastoreCredentials", - datastore_type: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AzureBlobDatastore(DatastoreProperties, discriminator="AzureBlob"): - """Azure Blob datastore configuration. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: [Required] Account credentials. Required. - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreCredentials - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar account_name: Storage account name. - :vartype account_name: str - :ivar container_name: Storage account container name. - :vartype container_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Known values are: "None", - "WorkspaceSystemAssignedIdentity", and "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceDataAccessAuthIdentity - :ivar datastore_type: [Required] Storage type backing the datastore. Required. AZURE_BLOB. - :vartype datastore_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_BLOB - """ - - resource_group: Optional[str] = rest_field( - name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Resource Group name.""" - subscription_id: Optional[str] = rest_field( - name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Subscription Id.""" - account_name: Optional[str] = rest_field(name="accountName", visibility=["read", "create"]) - """Storage account name.""" - container_name: Optional[str] = rest_field(name="containerName", visibility=["read", "create"]) - """Storage account container name.""" - endpoint: Optional[str] = rest_field(visibility=["read", "create"]) - """Azure cloud endpoint for the storage account.""" - protocol: Optional[str] = rest_field(visibility=["read", "create"]) - """Protocol used to communicate with the storage account.""" - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = rest_field( - name="serviceDataAccessAuthIdentity", visibility=["read", "create"] - ) - """Indicates which identity to use to authenticate service data access to customer's storage. - Known values are: \"None\", \"WorkspaceSystemAssignedIdentity\", and - \"WorkspaceUserAssignedIdentity\".""" - datastore_type: Literal[DatastoreType.AZURE_BLOB] = rest_discriminator(name="datastoreType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Storage type backing the datastore. Required. AZURE_BLOB.""" - - @overload - def __init__( - self, - *, - credentials: "_models.DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - account_name: Optional[str] = None, - container_name: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.datastore_type = DatastoreType.AZURE_BLOB # type: ignore - - -class AzureDataLakeGen1Datastore(DatastoreProperties, discriminator="AzureDataLakeGen1"): - """Azure Data Lake Gen1 datastore configuration. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: [Required] Account credentials. Required. - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreCredentials - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Known values are: "None", - "WorkspaceSystemAssignedIdentity", and "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceDataAccessAuthIdentity - :ivar store_name: [Required] Azure Data Lake store name. Required. - :vartype store_name: str - :ivar datastore_type: [Required] Storage type backing the datastore. Required. - AZURE_DATA_LAKE_GEN1. - :vartype datastore_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_DATA_LAKE_GEN1 - """ - - resource_group: Optional[str] = rest_field( - name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Resource Group name.""" - subscription_id: Optional[str] = rest_field( - name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Subscription Id.""" - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = rest_field( - name="serviceDataAccessAuthIdentity", visibility=["read", "create"] - ) - """Indicates which identity to use to authenticate service data access to customer's storage. - Known values are: \"None\", \"WorkspaceSystemAssignedIdentity\", and - \"WorkspaceUserAssignedIdentity\".""" - store_name: str = rest_field(name="storeName", visibility=["read", "create"]) - """[Required] Azure Data Lake store name. Required.""" - datastore_type: Literal[DatastoreType.AZURE_DATA_LAKE_GEN1] = rest_discriminator(name="datastoreType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Storage type backing the datastore. Required. AZURE_DATA_LAKE_GEN1.""" - - @overload - def __init__( - self, - *, - credentials: "_models.DatastoreCredentials", - store_name: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.datastore_type = DatastoreType.AZURE_DATA_LAKE_GEN1 # type: ignore - - -class AzureDataLakeGen2Datastore(DatastoreProperties, discriminator="AzureDataLakeGen2"): - """Azure Data Lake Gen2 datastore configuration. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: [Required] Account credentials. Required. - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreCredentials - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar account_name: [Required] Storage account name. Required. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar filesystem: [Required] The name of the Data Lake Gen2 filesystem. Required. - :vartype filesystem: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Known values are: "None", - "WorkspaceSystemAssignedIdentity", and "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceDataAccessAuthIdentity - :ivar datastore_type: [Required] Storage type backing the datastore. Required. - AZURE_DATA_LAKE_GEN2. - :vartype datastore_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_DATA_LAKE_GEN2 - """ - - resource_group: Optional[str] = rest_field( - name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Resource Group name.""" - subscription_id: Optional[str] = rest_field( - name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Subscription Id.""" - account_name: str = rest_field(name="accountName", visibility=["read", "create"]) - """[Required] Storage account name. Required.""" - endpoint: Optional[str] = rest_field(visibility=["read", "create"]) - """Azure cloud endpoint for the storage account.""" - filesystem: str = rest_field(visibility=["read", "create"]) - """[Required] The name of the Data Lake Gen2 filesystem. Required.""" - protocol: Optional[str] = rest_field(visibility=["read", "create"]) - """Protocol used to communicate with the storage account.""" - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = rest_field( - name="serviceDataAccessAuthIdentity", visibility=["read", "create"] - ) - """Indicates which identity to use to authenticate service data access to customer's storage. - Known values are: \"None\", \"WorkspaceSystemAssignedIdentity\", and - \"WorkspaceUserAssignedIdentity\".""" - datastore_type: Literal[DatastoreType.AZURE_DATA_LAKE_GEN2] = rest_discriminator(name="datastoreType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Storage type backing the datastore. Required. AZURE_DATA_LAKE_GEN2.""" - - @overload - def __init__( - self, - *, - credentials: "_models.DatastoreCredentials", - account_name: str, - filesystem: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.datastore_type = DatastoreType.AZURE_DATA_LAKE_GEN2 # type: ignore - - -class Webhook(_Model): - """Webhook base. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureDevOpsWebhook - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: [Required] Specifies the type of service to send a callback. Required. - "AzureDevOps" - :vartype webhook_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WebhookType - """ - - __mapping__: dict[str, _Model] = {} - event_type: Optional[str] = rest_field(name="eventType", visibility=["read", "create"]) - """Send callback on a specified notification event.""" - webhook_type: str = rest_discriminator(name="webhookType", visibility=["read", "create"]) - """[Required] Specifies the type of service to send a callback. Required. \"AzureDevOps\"""" - - @overload - def __init__( - self, - *, - webhook_type: str, - event_type: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AzureDevOpsWebhook(Webhook, discriminator="AzureDevOps"): - """Webhook details specific for Azure DevOps. - - :ivar event_type: Send callback on a specified notification event. - :vartype event_type: str - :ivar webhook_type: [Required] Specifies the type of service to send a callback. Required. - AZURE_DEV_OPS. - :vartype webhook_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_DEV_OPS - """ - - webhook_type: Literal[WebhookType.AZURE_DEV_OPS] = rest_discriminator(name="webhookType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of service to send a callback. Required. AZURE_DEV_OPS.""" - - @overload - def __init__( - self, - *, - event_type: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.webhook_type = WebhookType.AZURE_DEV_OPS # type: ignore - - -class AzureFileDatastore(DatastoreProperties, discriminator="AzureFile"): - """Azure File datastore configuration. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: [Required] Account credentials. Required. - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreCredentials - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar resource_group: Azure Resource Group name. - :vartype resource_group: str - :ivar subscription_id: Azure Subscription Id. - :vartype subscription_id: str - :ivar account_name: [Required] Storage account name. Required. - :vartype account_name: str - :ivar endpoint: Azure cloud endpoint for the storage account. - :vartype endpoint: str - :ivar file_share_name: [Required] The name of the Azure file share that the datastore points - to. Required. - :vartype file_share_name: str - :ivar protocol: Protocol used to communicate with the storage account. - :vartype protocol: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Known values are: "None", - "WorkspaceSystemAssignedIdentity", and "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceDataAccessAuthIdentity - :ivar datastore_type: [Required] Storage type backing the datastore. Required. AZURE_FILE. - :vartype datastore_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_FILE - """ - - resource_group: Optional[str] = rest_field( - name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Resource Group name.""" - subscription_id: Optional[str] = rest_field( - name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Subscription Id.""" - account_name: str = rest_field(name="accountName", visibility=["read", "create"]) - """[Required] Storage account name. Required.""" - endpoint: Optional[str] = rest_field(visibility=["read", "create"]) - """Azure cloud endpoint for the storage account.""" - file_share_name: str = rest_field(name="fileShareName", visibility=["read", "create"]) - """[Required] The name of the Azure file share that the datastore points to. Required.""" - protocol: Optional[str] = rest_field(visibility=["read", "create"]) - """Protocol used to communicate with the storage account.""" - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = rest_field( - name="serviceDataAccessAuthIdentity", visibility=["read", "create"] - ) - """Indicates which identity to use to authenticate service data access to customer's storage. - Known values are: \"None\", \"WorkspaceSystemAssignedIdentity\", and - \"WorkspaceUserAssignedIdentity\".""" - datastore_type: Literal[DatastoreType.AZURE_FILE] = rest_discriminator(name="datastoreType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Storage type backing the datastore. Required. AZURE_FILE.""" - - @overload - def __init__( - self, - *, - credentials: "_models.DatastoreCredentials", - account_name: str, - file_share_name: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - resource_group: Optional[str] = None, - subscription_id: Optional[str] = None, - endpoint: Optional[str] = None, - protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.datastore_type = DatastoreType.AZURE_FILE # type: ignore - - -class FineTuningVertical(_Model): - """FineTuningVertical. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureOpenAiFineTuning, CustomModelFineTuning - - :ivar model: [Required] Input model for fine tuning. Required. - :vartype model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar model_provider: [Required] Enum to determine the type of fine tuning. Required. Known - values are: "AzureOpenAI" and "Custom". - :vartype model_provider: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelProvider - :ivar task_type: [Required] Fine tuning task type. Required. Known values are: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", and "VideoMultiObjectTracking". - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FineTuningTaskType - :ivar training_data: [Required] Training data for fine tuning. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - """ - - __mapping__: dict[str, _Model] = {} - model: "_models.JobInput" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Input model for fine tuning. Required.""" - model_provider: str = rest_discriminator(name="modelProvider", visibility=["read", "create"]) - """[Required] Enum to determine the type of fine tuning. Required. Known values are: - \"AzureOpenAI\" and \"Custom\".""" - task_type: Union[str, "_models.FineTuningTaskType"] = rest_field(name="taskType", visibility=["read", "create"]) - """[Required] Fine tuning task type. Required. Known values are: \"ChatCompletion\", - \"TextCompletion\", \"TextClassification\", \"QuestionAnswering\", \"TextSummarization\", - \"TokenClassification\", \"TextTranslation\", \"ImageClassification\", - \"ImageInstanceSegmentation\", \"ImageObjectDetection\", and \"VideoMultiObjectTracking\".""" - training_data: "_models.JobInput" = rest_field( - name="trainingData", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Training data for fine tuning. Required.""" - validation_data: Optional["_models.JobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data for fine tuning.""" - - @overload - def __init__( - self, - *, - model: "_models.JobInput", - model_provider: str, - task_type: Union[str, "_models.FineTuningTaskType"], - training_data: "_models.JobInput", - validation_data: Optional["_models.JobInput"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AzureOpenAiFineTuning(FineTuningVertical, discriminator="AzureOpenAI"): - """AzureOpenAiFineTuning. - - :ivar model: [Required] Input model for fine tuning. Required. - :vartype model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar task_type: [Required] Fine tuning task type. Required. Known values are: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", and "VideoMultiObjectTracking". - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FineTuningTaskType - :ivar training_data: [Required] Training data for fine tuning. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning Azure Open AI model. - :vartype hyper_parameters: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AzureOpenAiHyperParameters - :ivar model_provider: [Required] Enum to determine the type of fine tuning. Required. Fine - tuning using Azure Open AI model. - :vartype model_provider: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_OPEN_AI - """ - - hyper_parameters: Optional["_models.AzureOpenAiHyperParameters"] = rest_field( - name="hyperParameters", visibility=["read", "create", "update", "delete", "query"] - ) - """HyperParameters for fine tuning Azure Open AI model.""" - model_provider: Literal[ModelProvider.AZURE_OPEN_AI] = rest_discriminator(name="modelProvider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Enum to determine the type of fine tuning. Required. Fine tuning using Azure Open AI - model.""" - - @overload - def __init__( - self, - *, - model: "_models.JobInput", - task_type: Union[str, "_models.FineTuningTaskType"], - training_data: "_models.JobInput", - validation_data: Optional["_models.JobInput"] = None, - hyper_parameters: Optional["_models.AzureOpenAiHyperParameters"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.model_provider = ModelProvider.AZURE_OPEN_AI # type: ignore - - -class AzureOpenAiHyperParameters(_Model): - """Azure Open AI hyperparameters for fine tuning. - - :ivar batch_size: Number of examples in each batch. A larger batch size means that model - parameters are updated less frequently, but with lower variance. - :vartype batch_size: int - :ivar learning_rate_multiplier: Scaling factor for the learning rate. A smaller learning rate - may be useful to avoid over fitting. - :vartype learning_rate_multiplier: float - :ivar n_epochs: The number of epochs to train the model for. An epoch refers to one full cycle - through the training dataset. - :vartype n_epochs: int - """ - - batch_size: Optional[int] = rest_field(name="batchSize", visibility=["read", "create", "update", "delete", "query"]) - """Number of examples in each batch. A larger batch size means that model parameters are updated - less frequently, but with lower variance.""" - learning_rate_multiplier: Optional[float] = rest_field( - name="learningRateMultiplier", visibility=["read", "create", "update", "delete", "query"] - ) - """Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over - fitting.""" - n_epochs: Optional[int] = rest_field(name="nEpochs", visibility=["read", "create", "update", "delete", "query"]) - """The number of epochs to train the model for. An epoch refers to one full cycle through the - training dataset.""" - - @overload - def __init__( - self, - *, - batch_size: Optional[int] = None, - learning_rate_multiplier: Optional[float] = None, - n_epochs: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EarlyTerminationPolicy(_Model): - """Early termination policies enable canceling poor-performing runs before they complete. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - BanditPolicy, MedianStoppingPolicy, TruncationSelectionPolicy - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: [Required] Name of policy configuration. Required. Known values are: - "Bandit", "MedianStopping", and "TruncationSelection". - :vartype policy_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EarlyTerminationPolicyType - """ - - __mapping__: dict[str, _Model] = {} - delay_evaluation: Optional[int] = rest_field( - name="delayEvaluation", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of intervals by which to delay the first evaluation.""" - evaluation_interval: Optional[int] = rest_field( - name="evaluationInterval", visibility=["read", "create", "update", "delete", "query"] - ) - """Interval (number of runs) between policy evaluations.""" - policy_type: str = rest_discriminator(name="policyType", visibility=["read", "create", "update", "delete", "query"]) - """[Required] Name of policy configuration. Required. Known values are: \"Bandit\", - \"MedianStopping\", and \"TruncationSelection\".""" - - @overload - def __init__( - self, - *, - policy_type: str, - delay_evaluation: Optional[int] = None, - evaluation_interval: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BanditPolicy(EarlyTerminationPolicy, discriminator="Bandit"): - """Defines an early termination policy based on slack criteria, and a frequency and delay interval - for evaluation. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar slack_amount: Absolute distance allowed from the best performing run. - :vartype slack_amount: float - :ivar slack_factor: Ratio of the allowed distance from the best performing run. - :vartype slack_factor: float - :ivar policy_type: [Required] Name of policy configuration. Required. BANDIT. - :vartype policy_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BANDIT - """ - - slack_amount: Optional[float] = rest_field( - name="slackAmount", visibility=["read", "create", "update", "delete", "query"] - ) - """Absolute distance allowed from the best performing run.""" - slack_factor: Optional[float] = rest_field( - name="slackFactor", visibility=["read", "create", "update", "delete", "query"] - ) - """Ratio of the allowed distance from the best performing run.""" - policy_type: Literal[EarlyTerminationPolicyType.BANDIT] = rest_discriminator(name="policyType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Name of policy configuration. Required. BANDIT.""" - - @overload - def __init__( - self, - *, - delay_evaluation: Optional[int] = None, - evaluation_interval: Optional[int] = None, - slack_amount: Optional[float] = None, - slack_factor: Optional[float] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.policy_type = EarlyTerminationPolicyType.BANDIT # type: ignore - - -class Resource(_Model): - """Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class TrackedResource(Resource): - """Tracked Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - location: str = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives. Required.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BatchDeployment(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeploymentProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.BatchDeploymentProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.BatchDeploymentProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BatchDeploymentConfiguration(_Model): - """Properties relevant to different deployment types. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - BatchPipelineComponentDeploymentConfiguration - - :ivar deployment_configuration_type: [Required] The type of the deployment. Required. Known - values are: "Model" and "PipelineComponent". - :vartype deployment_configuration_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeploymentConfigurationType - """ - - __mapping__: dict[str, _Model] = {} - deployment_configuration_type: str = rest_discriminator( - name="deploymentConfigurationType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The type of the deployment. Required. Known values are: \"Model\" and - \"PipelineComponent\".""" - - @overload - def __init__( - self, - *, - deployment_configuration_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointDeploymentPropertiesBase(_Model): - """Base definition for endpoint deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - """ - - code_configuration: Optional["_models.CodeConfiguration"] = rest_field( - name="codeConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Code configuration for the endpoint deployment.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the endpoint deployment.""" - environment_id: Optional[str] = rest_field( - name="environmentId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM resource ID or AssetId of the environment specification for the endpoint deployment.""" - environment_variables: Optional[dict[str, str]] = rest_field( - name="environmentVariables", visibility=["read", "create", "update", "delete", "query"] - ) - """Environment variables configuration for the deployment.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Property dictionary. Properties can be added, but not removed or altered.""" - - @overload - def __init__( - self, - *, - code_configuration: Optional["_models.CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): - """Batch inference settings per deployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar compute: Compute target for batch inference operation. - :vartype compute: str - :ivar deployment_configuration: Properties relevant to different deployment types. - :vartype deployment_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeploymentConfiguration - :ivar error_threshold: Error threshold, if the error count for the entire input goes above this - value, the batch inference will be aborted. Range is [-1, int.MaxValue]. For FileDataset, this - value is the count of file failures. For TabularDataset, this value is the count of record - failures. If set to -1 (the lower bound), all failures during batch inference will be ignored. - :vartype error_threshold: int - :ivar logging_level: Log verbosity for batch inferencing. Increasing verbosity order for - logging is : Warning, Info and Debug. The default value is Info. Known values are: "Info", - "Warning", and "Debug". - :vartype logging_level: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchLoggingLevel - :ivar max_concurrency_per_instance: Indicates maximum number of parallelism per instance. - :vartype max_concurrency_per_instance: int - :ivar mini_batch_size: Size of the mini-batch passed to each batch invocation. For FileDataset, - this is the number of files per mini-batch. For TabularDataset, this is the size of the records - in bytes, per mini-batch. - :vartype mini_batch_size: int - :ivar model: Reference to the model asset for the endpoint deployment. - :vartype model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetReferenceBase - :ivar output_action: Enum to determine how batch inferencing will handle output. Known values - are: "SummaryOnly" and "AppendRow". - :vartype output_action: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchOutputAction - :ivar output_file_name: Customized output file name for append_row output action. - :vartype output_file_name: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Known values are: - "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentProvisioningState - :ivar resources: Indicates compute configuration for the job. If not provided, will default to - the defaults defined in ResourceConfiguration. - :vartype resources: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentResourceConfiguration - :ivar retry_settings: Retry Settings for the batch inference operation. If not provided, will - default to the defaults defined in BatchRetrySettings. - :vartype retry_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchRetrySettings - """ - - compute: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Compute target for batch inference operation.""" - deployment_configuration: Optional["_models.BatchDeploymentConfiguration"] = rest_field( - name="deploymentConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Properties relevant to different deployment types.""" - error_threshold: Optional[int] = rest_field( - name="errorThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """Error threshold, if the error count for the entire input goes above this value, the batch - inference will be aborted. Range is [-1, int.MaxValue]. For FileDataset, this value is the - count of file failures. For TabularDataset, this value is the count of record failures. If set - to -1 (the lower bound), all failures during batch inference will be ignored.""" - logging_level: Optional[Union[str, "_models.BatchLoggingLevel"]] = rest_field( - name="loggingLevel", visibility=["read", "create", "update", "delete", "query"] - ) - """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info - and Debug. The default value is Info. Known values are: \"Info\", \"Warning\", and \"Debug\".""" - max_concurrency_per_instance: Optional[int] = rest_field( - name="maxConcurrencyPerInstance", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates maximum number of parallelism per instance.""" - mini_batch_size: Optional[int] = rest_field( - name="miniBatchSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Size of the mini-batch passed to each batch invocation. For FileDataset, this is the number of - files per mini-batch. For TabularDataset, this is the size of the records in bytes, per - mini-batch.""" - model: Optional["_models.AssetReferenceBase"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Reference to the model asset for the endpoint deployment.""" - output_action: Optional[Union[str, "_models.BatchOutputAction"]] = rest_field( - name="outputAction", visibility=["read", "create", "update", "delete", "query"] - ) - """Enum to determine how batch inferencing will handle output. Known values are: \"SummaryOnly\" - and \"AppendRow\".""" - output_file_name: Optional[str] = rest_field( - name="outputFileName", visibility=["read", "create", "update", "delete", "query"] - ) - """Customized output file name for append_row output action.""" - provisioning_state: Optional[Union[str, "_models.DeploymentProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the endpoint deployment. Known values are: \"Creating\", \"Deleting\", - \"Scaling\", \"Updating\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - resources: Optional["_models.DeploymentResourceConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates compute configuration for the job. If not provided, will default to the defaults - defined in ResourceConfiguration.""" - retry_settings: Optional["_models.BatchRetrySettings"] = rest_field( - name="retrySettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Retry Settings for the batch inference operation. If not provided, will default to the defaults - defined in BatchRetrySettings.""" - - @overload - def __init__( - self, - *, - code_configuration: Optional["_models.CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, - compute: Optional[str] = None, - deployment_configuration: Optional["_models.BatchDeploymentConfiguration"] = None, - error_threshold: Optional[int] = None, - logging_level: Optional[Union[str, "_models.BatchLoggingLevel"]] = None, - max_concurrency_per_instance: Optional[int] = None, - mini_batch_size: Optional[int] = None, - model: Optional["_models.AssetReferenceBase"] = None, - output_action: Optional[Union[str, "_models.BatchOutputAction"]] = None, - output_file_name: Optional[str] = None, - resources: Optional["_models.DeploymentResourceConfiguration"] = None, - retry_settings: Optional["_models.BatchRetrySettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BatchEndpoint(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpointProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.BatchEndpointProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.BatchEndpointProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BatchEndpointDefaults(_Model): - """Batch endpoint default values. - - :ivar deployment_name: Name of the deployment that will be default for the endpoint. This - deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. - :vartype deployment_name: str - """ - - deployment_name: Optional[str] = rest_field( - name="deploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the deployment that will be default for the endpoint. This deployment will end up - getting 100% traffic when the endpoint scoring URL is invoked.""" - - @overload - def __init__( - self, - *, - deployment_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointPropertiesBase(_Model): - """Inference Endpoint base definition. - - :ivar auth_mode: [Required] The authentication method for invoking the endpoint (data plane - operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine Learning - token-based authentication. Use 'AADToken' for Microsoft Entra token-based authentication. - Required. Known values are: "AMLToken", "Key", and "AADToken". - :vartype auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys_property: EndpointAuthKeys to set initially on an Endpoint. This property will - always be returned as null. AuthKey values must be retrieved using the ListKeys API. - :vartype keys_property: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - """ - - auth_mode: Union[str, "_models.EndpointAuthMode"] = rest_field( - name="authMode", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The authentication method for invoking the endpoint (data plane operation). Use - 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine Learning token-based - authentication. Use 'AADToken' for Microsoft Entra token-based authentication. Required. Known - values are: \"AMLToken\", \"Key\", and \"AADToken\".""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the inference endpoint.""" - keys_property: Optional["_models.EndpointAuthKeys"] = rest_field( - name="keys", visibility=["create"], original_tsp_name="keys" - ) - """EndpointAuthKeys to set initially on an Endpoint. This property will always be returned as - null. AuthKey values must be retrieved using the ListKeys API.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Property dictionary. Properties can be added, but not removed or altered.""" - scoring_uri: Optional[str] = rest_field(name="scoringUri", visibility=["read"]) - """Endpoint URI.""" - swagger_uri: Optional[str] = rest_field(name="swaggerUri", visibility=["read"]) - """Endpoint Swagger URI.""" - - @overload - def __init__( - self, - *, - auth_mode: Union[str, "_models.EndpointAuthMode"], - description: Optional[str] = None, - keys_property: Optional["_models.EndpointAuthKeys"] = None, - properties: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BatchEndpointProperties(EndpointPropertiesBase): - """Batch endpoint configuration. - - :ivar auth_mode: [Required] The authentication method for invoking the endpoint (data plane - operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine Learning - token-based authentication. Use 'AADToken' for Microsoft Entra token-based authentication. - Required. Known values are: "AMLToken", "Key", and "AADToken". - :vartype auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys_property: EndpointAuthKeys to set initially on an Endpoint. This property will - always be returned as null. AuthKey values must be retrieved using the ListKeys API. - :vartype keys_property: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar defaults: Default values for Batch Endpoint. - :vartype defaults: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpointDefaults - :ivar provisioning_state: Provisioning state for the endpoint. Known values are: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointProvisioningState - """ - - defaults: Optional["_models.BatchEndpointDefaults"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Default values for Batch Endpoint.""" - provisioning_state: Optional[Union[str, "_models.EndpointProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the endpoint. Known values are: \"Creating\", \"Deleting\", - \"Succeeded\", \"Failed\", \"Updating\", and \"Canceled\".""" - - @overload - def __init__( - self, - *, - auth_mode: Union[str, "_models.EndpointAuthMode"], - description: Optional[str] = None, - keys_property: Optional["_models.EndpointAuthKeys"] = None, - properties: Optional[dict[str, str]] = None, - defaults: Optional["_models.BatchEndpointDefaults"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BatchPipelineComponentDeploymentConfiguration( - BatchDeploymentConfiguration, discriminator="PipelineComponent" -): # pylint: disable=name-too-long - """Properties for a Batch Pipeline Component Deployment. - - :ivar component_id: The ARM id of the component to be run. - :vartype component_id: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdAssetReference - :ivar description: The description which will be applied to the job. - :vartype description: str - :ivar settings: Run-time settings for the pipeline job. - :vartype settings: dict[str, str] - :ivar tags: The tags which will be applied to the job. - :vartype tags: dict[str, str] - :ivar deployment_configuration_type: [Required] The type of the deployment. Required. - PIPELINE_COMPONENT. - :vartype deployment_configuration_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PIPELINE_COMPONENT - """ - - component_id: Optional["_models.IdAssetReference"] = rest_field( - name="componentId", visibility=["read", "create", "update", "delete", "query"] - ) - """The ARM id of the component to be run.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description which will be applied to the job.""" - settings: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Run-time settings for the pipeline job.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The tags which will be applied to the job.""" - deployment_configuration_type: Literal[BatchDeploymentConfigurationType.PIPELINE_COMPONENT] = rest_discriminator(name="deploymentConfigurationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] The type of the deployment. Required. PIPELINE_COMPONENT.""" - - @overload - def __init__( - self, - *, - component_id: Optional["_models.IdAssetReference"] = None, - description: Optional[str] = None, - settings: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.deployment_configuration_type = BatchDeploymentConfigurationType.PIPELINE_COMPONENT # type: ignore - - -class BatchRetrySettings(_Model): - """Retry settings for a batch inference operation. - - :ivar max_retries: Maximum retry count for a mini-batch. - :vartype max_retries: int - :ivar timeout: Invocation timeout for a mini-batch, in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - max_retries: Optional[int] = rest_field( - name="maxRetries", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum retry count for a mini-batch.""" - timeout: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Invocation timeout for a mini-batch, in ISO 8601 format.""" - - @overload - def __init__( - self, - *, - max_retries: Optional[int] = None, - timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SamplingAlgorithm(_Model): - """The Sampling Algorithm used to generate hyperparameter values, along with properties to - configure the algorithm. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm - - :ivar sampling_algorithm_type: [Required] The algorithm used for generating hyperparameter - values, along with configuration properties. Required. Known values are: "Grid", "Random", and - "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SamplingAlgorithmType - """ - - __mapping__: dict[str, _Model] = {} - sampling_algorithm_type: str = rest_discriminator( - name="samplingAlgorithmType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The algorithm used for generating hyperparameter values, along with configuration - properties. Required. Known values are: \"Grid\", \"Random\", and \"Bayesian\".""" - - @overload - def __init__( - self, - *, - sampling_algorithm_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BayesianSamplingAlgorithm(SamplingAlgorithm, discriminator="Bayesian"): - """Defines a Sampling Algorithm that generates values based on previous values. - - :ivar sampling_algorithm_type: [Required] The algorithm used for generating hyperparameter - values, along with configuration properties. Required. BAYESIAN. - :vartype sampling_algorithm_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BAYESIAN - """ - - sampling_algorithm_type: Literal[SamplingAlgorithmType.BAYESIAN] = rest_discriminator(name="samplingAlgorithmType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] The algorithm used for generating hyperparameter values, along with configuration - properties. Required. BAYESIAN.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.sampling_algorithm_type = SamplingAlgorithmType.BAYESIAN # type: ignore - - -class BindOptions(_Model): - """BindOptions. - - :ivar propagation: Type of Bind Option. - :vartype propagation: str - :ivar create_host_path: Indicate whether to create host path. - :vartype create_host_path: bool - :ivar selinux: Mention the selinux options. - :vartype selinux: str - """ - - propagation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Type of Bind Option.""" - create_host_path: Optional[bool] = rest_field( - name="createHostPath", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicate whether to create host path.""" - selinux: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Mention the selinux options.""" - - @overload - def __init__( - self, - *, - propagation: Optional[str] = None, - create_host_path: Optional[bool] = None, - selinux: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BlobReferenceForConsumptionDto(_Model): - """BlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob URI path for client to upload data. Example: - `https://blob.windows.core.net/Container/Path `_. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadCredentialDto - :ivar storage_account_arm_id: Arm ID of the storage account to use. - :vartype storage_account_arm_id: str - """ - - blob_uri: Optional[str] = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path - `_.""" - credential: Optional["_models.PendingUploadCredentialDto"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Credential info to access storage account.""" - storage_account_arm_id: Optional[str] = rest_field( - name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """Arm ID of the storage account to use.""" - - @overload - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["_models.PendingUploadCredentialDto"] = None, - storage_account_arm_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class BuildContext(_Model): - """Configuration settings for Docker build context. - - :ivar context_uri: [Required] URI of the Docker build context used to build the image. Supports - blob URIs on environment creation and may return blob or Git URIs. . - Required. - :vartype context_uri: str - :ivar dockerfile_path: Path to the Dockerfile in the build context. . - :vartype dockerfile_path: str - """ - - context_uri: str = rest_field(name="contextUri", visibility=["read", "create"]) - """[Required] URI of the Docker build context used to build the image. Supports blob URIs on - environment creation and may return blob or Git URIs. . - Required.""" - dockerfile_path: Optional[str] = rest_field(name="dockerfilePath", visibility=["read", "create"]) - """Path to the Dockerfile in the build context. .""" - - @overload - def __init__( - self, - *, - context_uri: str, - dockerfile_path: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ProxyResource(Resource): - """Proxy Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - """ - - -class CapabilityHost(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHostProperties - """ - - properties: "_models.CapabilityHostProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.CapabilityHostProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CapabilityHostProperties(ResourceBase): - """CapabilityHostProperties. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar aca_environment_connections: List of Aca Environment connections. - :vartype aca_environment_connections: list[str] - :ivar ai_services_connections: List of AI services connections. - :vartype ai_services_connections: list[str] - :ivar capability_host_kind: Kind of this capability host. "Agents" - :vartype capability_host_kind: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHostKind - :ivar customer_subnet: Customer subnet info to help set up this capability host. - :vartype customer_subnet: str - :ivar provisioning_state: Provisioning state for the CapabilityHost. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHostProvisioningState - :ivar storage_connections: List of Storage connections. - :vartype storage_connections: list[str] - :ivar thread_storage_connections: List of Thread storage connections. - :vartype thread_storage_connections: list[str] - :ivar vector_store_connections: List of VectorStore connections. - :vartype vector_store_connections: list[str] - :ivar messages: List of messages containing errors. - :vartype messages: list[str] - """ - - aca_environment_connections: Optional[list[str]] = rest_field( - name="acaEnvironmentConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of Aca Environment connections.""" - ai_services_connections: Optional[list[str]] = rest_field( - name="aiServicesConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of AI services connections.""" - capability_host_kind: Optional[Union[str, "_models.CapabilityHostKind"]] = rest_field( - name="capabilityHostKind", visibility=["read", "create", "update", "delete", "query"] - ) - """Kind of this capability host. \"Agents\"""" - customer_subnet: Optional[str] = rest_field( - name="customerSubnet", visibility=["read", "create", "update", "delete", "query"] - ) - """Customer subnet info to help set up this capability host.""" - provisioning_state: Optional[Union[str, "_models.CapabilityHostProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the CapabilityHost. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - storage_connections: Optional[list[str]] = rest_field( - name="storageConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of Storage connections.""" - thread_storage_connections: Optional[list[str]] = rest_field( - name="threadStorageConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of Thread storage connections.""" - vector_store_connections: Optional[list[str]] = rest_field( - name="vectorStoreConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of VectorStore connections.""" - messages: Optional[list[str]] = rest_field(visibility=["read"]) - """List of messages containing errors.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - aca_environment_connections: Optional[list[str]] = None, - ai_services_connections: Optional[list[str]] = None, - capability_host_kind: Optional[Union[str, "_models.CapabilityHostKind"]] = None, - customer_subnet: Optional[str] = None, - storage_connections: Optional[list[str]] = None, - thread_storage_connections: Optional[list[str]] = None, - vector_store_connections: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataDriftMetricThresholdBase(_Model): - """DataDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CategoricalDataDriftMetricThreshold, NumericalDataDriftMetricThreshold - - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Known - values are: "Numerical" and "Categorical". - :vartype data_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - """ - - __mapping__: dict[str, _Model] = {} - data_type: str = rest_discriminator(name="dataType", visibility=["read", "create"]) - """[Required] Specifies the data type of the metric threshold. Required. Known values are: - \"Numerical\" and \"Categorical\".""" - threshold: Optional["_models.MonitoringThreshold"] = rest_field(visibility=["read", "create"]) - """The threshold value. If null, a default value will be set depending on the selected metric.""" - - @overload - def __init__( - self, - *, - data_type: str, - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase, discriminator="Categorical"): - """CategoricalDataDriftMetricThreshold. - - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - :ivar metric: [Required] The categorical data drift metric to calculate. Required. Known values - are: "JensenShannonDistance", "PopulationStabilityIndex", and "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CategoricalDataDriftMetric - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Used for - features of categorical data type. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CATEGORICAL - """ - - metric: Union[str, "_models.CategoricalDataDriftMetric"] = rest_field(visibility=["read", "create"]) - """[Required] The categorical data drift metric to calculate. Required. Known values are: - \"JensenShannonDistance\", \"PopulationStabilityIndex\", and \"PearsonsChiSquaredTest\".""" - data_type: Literal[MonitoringFeatureDataType.CATEGORICAL] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the data type of the metric threshold. Required. Used for features of - categorical data type.""" - - @overload - def __init__( - self, - *, - metric: Union[str, "_models.CategoricalDataDriftMetric"], - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = MonitoringFeatureDataType.CATEGORICAL # type: ignore - - -class DataQualityMetricThresholdBase(_Model): - """DataQualityMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CategoricalDataQualityMetricThreshold, NumericalDataQualityMetricThreshold - - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Known - values are: "Numerical" and "Categorical". - :vartype data_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - """ - - __mapping__: dict[str, _Model] = {} - data_type: str = rest_discriminator(name="dataType", visibility=["read", "create"]) - """[Required] Specifies the data type of the metric threshold. Required. Known values are: - \"Numerical\" and \"Categorical\".""" - threshold: Optional["_models.MonitoringThreshold"] = rest_field(visibility=["read", "create"]) - """The threshold value. If null, a default value will be set depending on the selected metric.""" - - @overload - def __init__( - self, - *, - data_type: str, - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase, discriminator="Categorical"): - """CategoricalDataQualityMetricThreshold. - - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - :ivar metric: [Required] The categorical data quality metric to calculate. Required. Known - values are: "NullValueRate", "DataTypeErrorRate", and "OutOfBoundsRate". - :vartype metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CategoricalDataQualityMetric - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Used for - features of categorical data type. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CATEGORICAL - """ - - metric: Union[str, "_models.CategoricalDataQualityMetric"] = rest_field(visibility=["read", "create"]) - """[Required] The categorical data quality metric to calculate. Required. Known values are: - \"NullValueRate\", \"DataTypeErrorRate\", and \"OutOfBoundsRate\".""" - data_type: Literal[MonitoringFeatureDataType.CATEGORICAL] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the data type of the metric threshold. Required. Used for features of - categorical data type.""" - - @overload - def __init__( - self, - *, - metric: Union[str, "_models.CategoricalDataQualityMetric"], - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = MonitoringFeatureDataType.CATEGORICAL # type: ignore - - -class PredictionDriftMetricThresholdBase(_Model): - """PredictionDriftMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CategoricalPredictionDriftMetricThreshold, NumericalPredictionDriftMetricThreshold - - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Known - values are: "Numerical" and "Categorical". - :vartype data_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureDataType - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - """ - - __mapping__: dict[str, _Model] = {} - data_type: str = rest_discriminator(name="dataType", visibility=["read", "create"]) - """[Required] Specifies the data type of the metric threshold. Required. Known values are: - \"Numerical\" and \"Categorical\".""" - threshold: Optional["_models.MonitoringThreshold"] = rest_field(visibility=["read", "create"]) - """The threshold value. If null, a default value will be set depending on the selected metric.""" - - @overload - def __init__( - self, - *, - data_type: str, - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CategoricalPredictionDriftMetricThreshold( - PredictionDriftMetricThresholdBase, discriminator="Categorical" -): # pylint: disable=name-too-long - """CategoricalPredictionDriftMetricThreshold. - - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - :ivar metric: [Required] The categorical prediction drift metric to calculate. Required. Known - values are: "JensenShannonDistance", "PopulationStabilityIndex", and "PearsonsChiSquaredTest". - :vartype metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CategoricalPredictionDriftMetric - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Used for - features of categorical data type. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CATEGORICAL - """ - - metric: Union[str, "_models.CategoricalPredictionDriftMetric"] = rest_field(visibility=["read", "create"]) - """[Required] The categorical prediction drift metric to calculate. Required. Known values are: - \"JensenShannonDistance\", \"PopulationStabilityIndex\", and \"PearsonsChiSquaredTest\".""" - data_type: Literal[MonitoringFeatureDataType.CATEGORICAL] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the data type of the metric threshold. Required. Used for features of - categorical data type.""" - - @overload - def __init__( - self, - *, - metric: Union[str, "_models.CategoricalPredictionDriftMetric"], - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = MonitoringFeatureDataType.CATEGORICAL # type: ignore - - -class CertificateDatastoreCredentials(DatastoreCredentials, discriminator="Certificate"): - """Certificate datastore credentials configuration. - - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: [Required] Service principal client ID. Required. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: [Required] Service principal secrets. Required. - :vartype secrets: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CertificateDatastoreSecrets - :ivar tenant_id: [Required] ID of the tenant to which the service principal belongs. Required. - :vartype tenant_id: str - :ivar thumbprint: [Required] Thumbprint of the certificate used for authentication. Required. - :vartype thumbprint: str - :ivar credentials_type: [Required] Credential type used to authentication with storage. - Required. CERTIFICATE. - :vartype credentials_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CERTIFICATE - """ - - authority_url: Optional[str] = rest_field( - name="authorityUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Authority URL used for authentication.""" - client_id: str = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - """[Required] Service principal client ID. Required.""" - resource_url: Optional[str] = rest_field( - name="resourceUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Resource the service principal has access to.""" - secrets: "_models.CertificateDatastoreSecrets" = rest_field(visibility=["create", "update"]) - """[Required] Service principal secrets. Required.""" - tenant_id: str = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """[Required] ID of the tenant to which the service principal belongs. Required.""" - thumbprint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Thumbprint of the certificate used for authentication. Required.""" - credentials_type: Literal[CredentialsType.CERTIFICATE] = rest_discriminator(name="credentialsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. CERTIFICATE.""" - - @overload - def __init__( - self, - *, - client_id: str, - secrets: "_models.CertificateDatastoreSecrets", - tenant_id: str, - thumbprint: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credentials_type = CredentialsType.CERTIFICATE # type: ignore - - -class CertificateDatastoreSecrets(DatastoreSecrets, discriminator="Certificate"): - """Datastore certificate secrets. - - :ivar certificate: Service principal certificate. - :vartype certificate: str - :ivar secrets_type: [Required] Credential type used to authentication with storage. Required. - CERTIFICATE. - :vartype secrets_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CERTIFICATE - """ - - certificate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Service principal certificate.""" - secrets_type: Literal[SecretsType.CERTIFICATE] = rest_discriminator(name="secretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. CERTIFICATE.""" - - @overload - def __init__( - self, - *, - certificate: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.secrets_type = SecretsType.CERTIFICATE # type: ignore - - -class Classification(AutoMLVertical, discriminator="Classification"): - """Classification task in AutoML Table vertical. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar positive_label: Positive label for binary metrics calculation. - :vartype positive_label: str - :ivar primary_metric: Primary metrics for classification tasks. Known values are: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", and - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationTrainingSettings - :ivar task_type: [Required] Task type for AutoMLJob. Required. Classification in machine - learning and statistics is a supervised learning approach in which the computer program learns - from the data given to it and make new observations or classifications. - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CLASSIFICATION - """ - - cv_split_column_names: Optional[list[str]] = rest_field( - name="cvSplitColumnNames", visibility=["read", "create", "update", "delete", "query"] - ) - """Columns to use for CVSplit data.""" - featurization_settings: Optional["_models.TableVerticalFeaturizationSettings"] = rest_field( - name="featurizationSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Featurization inputs needed for AutoML job.""" - limit_settings: Optional["_models.TableVerticalLimitSettings"] = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Execution constraints for AutoMLJob.""" - n_cross_validations: Optional["_models.NCrossValidations"] = rest_field( - name="nCrossValidations", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of cross validation folds to be applied on training dataset when validation dataset is - not provided.""" - test_data: Optional["_models.MLTableJobInput"] = rest_field( - name="testData", visibility=["read", "create", "update", "delete", "query"] - ) - """Test data input.""" - test_data_size: Optional[float] = rest_field( - name="testDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of test dataset that needs to be set aside for validation purpose. Values between - (0.0 , 1.0) Applied when validation dataset is not provided.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - validation_data_size: Optional[float] = rest_field( - name="validationDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of training dataset that needs to be set aside for validation purpose. Values - between (0.0 , 1.0) Applied when validation dataset is not provided.""" - weight_column_name: Optional[str] = rest_field( - name="weightColumnName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the sample weight column. Automated ML supports a weighted column as an input, - causing rows in the data to be weighted up or down.""" - positive_label: Optional[str] = rest_field( - name="positiveLabel", visibility=["read", "create", "update", "delete", "query"] - ) - """Positive label for binary metrics calculation.""" - primary_metric: Optional[Union[str, "_models.ClassificationPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for classification tasks. Known values are: \"AUCWeighted\", \"Accuracy\", - \"NormMacroRecall\", \"AveragePrecisionScoreWeighted\", and \"PrecisionScoreWeighted\".""" - training_settings: Optional["_models.ClassificationTrainingSettings"] = rest_field( - name="trainingSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Inputs for training phase for an AutoML Job.""" - task_type: Literal[TaskType.CLASSIFICATION] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Classification in machine learning and statistics - is a supervised learning approach in which the computer program learns from the data given to - it and make new observations or classifications.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - cv_split_column_names: Optional[list[str]] = None, - featurization_settings: Optional["_models.TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["_models.TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["_models.NCrossValidations"] = None, - test_data: Optional["_models.MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "_models.ClassificationPrimaryMetrics"]] = None, - training_settings: Optional["_models.ClassificationTrainingSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.CLASSIFICATION # type: ignore - - -class TrainingSettings(_Model): - """Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. Configure this - parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StackEnsembleSettings - """ - - enable_dnn_training: Optional[bool] = rest_field( - name="enableDnnTraining", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable recommendation of DNN models.""" - enable_model_explainability: Optional[bool] = rest_field( - name="enableModelExplainability", visibility=["read", "create", "update", "delete", "query"] - ) - """Flag to turn on explainability on best model.""" - enable_onnx_compatible_models: Optional[bool] = rest_field( - name="enableOnnxCompatibleModels", visibility=["read", "create", "update", "delete", "query"] - ) - """Flag for enabling onnx compatible models.""" - enable_stack_ensemble: Optional[bool] = rest_field( - name="enableStackEnsemble", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable stack ensemble run.""" - enable_vote_ensemble: Optional[bool] = rest_field( - name="enableVoteEnsemble", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable voting ensemble run.""" - ensemble_model_download_timeout: Optional[datetime.timedelta] = rest_field( - name="ensembleModelDownloadTimeout", visibility=["read", "create", "update", "delete", "query"] - ) - """During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the - previous child runs are downloaded. Configure this parameter with a higher value than 300 secs, - if more time is needed.""" - stack_ensemble_settings: Optional["_models.StackEnsembleSettings"] = rest_field( - name="stackEnsembleSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Stack ensemble settings for stack ensemble run.""" - - @overload - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = None, - enable_model_explainability: Optional[bool] = None, - enable_onnx_compatible_models: Optional[bool] = None, - enable_stack_ensemble: Optional[bool] = None, - enable_vote_ensemble: Optional[bool] = None, - ensemble_model_download_timeout: Optional[datetime.timedelta] = None, - stack_ensemble_settings: Optional["_models.StackEnsembleSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ClassificationTrainingSettings(TrainingSettings): - """Classification Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. Configure this - parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for classification task. - :vartype allowed_training_algorithms: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationModels] - :ivar blocked_training_algorithms: Blocked models for classification task. - :vartype blocked_training_algorithms: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationModels] - """ - - allowed_training_algorithms: Optional[list[Union[str, "_models.ClassificationModels"]]] = rest_field( - name="allowedTrainingAlgorithms", visibility=["read", "create", "update", "delete", "query"] - ) - """Allowed models for classification task.""" - blocked_training_algorithms: Optional[list[Union[str, "_models.ClassificationModels"]]] = rest_field( - name="blockedTrainingAlgorithms", visibility=["read", "create", "update", "delete", "query"] - ) - """Blocked models for classification task.""" - - @overload - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = None, - enable_model_explainability: Optional[bool] = None, - enable_onnx_compatible_models: Optional[bool] = None, - enable_stack_ensemble: Optional[bool] = None, - enable_vote_ensemble: Optional[bool] = None, - ensemble_model_download_timeout: Optional[datetime.timedelta] = None, - stack_ensemble_settings: Optional["_models.StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[list[Union[str, "_models.ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[list[Union[str, "_models.ClassificationModels"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ClusterUpdateParameters(_Model): - """AmlCompute update parameters. - - :ivar properties: The properties of the amlCompute. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClusterUpdateProperties - """ - - properties: Optional["_models.ClusterUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the amlCompute.""" - - __flattened_items = ["properties"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.ClusterUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class ClusterUpdateProperties(_Model): - """The properties of a amlCompute that need to be updated. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScaleSettingsInformation - """ - - properties: Optional["_models.ScaleSettingsInformation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of ClusterUpdate.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ScaleSettingsInformation"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CodeConfiguration(_Model): - """Configuration for a scoring code asset. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar scoring_script: [Required] The script to execute on startup. eg. "score.py". Required. - :vartype scoring_script: str - """ - - code_id: Optional[str] = rest_field(name="codeId", visibility=["read", "create"]) - """ARM resource ID of the code asset.""" - scoring_script: str = rest_field(name="scoringScript", visibility=["read", "create"]) - """[Required] The script to execute on startup. eg. \"score.py\". Required.""" - - @overload - def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CodeContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainerProperties - """ - - properties: "_models.CodeContainerProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.CodeContainerProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CodeContainerProperties(AssetContainer): - """Container for code asset versions. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the code container. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the code container. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CodeVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersionProperties - """ - - properties: "_models.CodeVersionProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.CodeVersionProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CodeVersionProperties(AssetBase): - """Code asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar code_uri: Uri where code is located. - :vartype code_uri: str - :ivar provisioning_state: Provisioning state for the code version. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - code_uri: Optional[str] = rest_field(name="codeUri", visibility=["read", "create", "update", "delete", "query"]) - """Uri where code is located.""" - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the code version. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - code_uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CognitiveServicesSku(_Model): - """CognitiveServicesSku. - - :ivar capacity: - :vartype capacity: int - :ivar family: - :vartype family: str - :ivar name: - :vartype name: str - :ivar size: - :vartype size: str - :ivar tier: - :vartype tier: str - """ - - capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Collection(_Model): - """Collection. - - :ivar client_id: The msi client id used to collect logging to blob storage. If it's - null,backend will pick a registered endpoint identity to auth. - :vartype client_id: str - :ivar data_collection_mode: Enable or disable data collection. Known values are: "Enabled" and - "Disabled". - :vartype data_collection_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataCollectionMode - :ivar data_id: The data asset arm resource id. Client side will ensure data asset is pointing - to the blob storage, and backend will collect data to the blob storage. - :vartype data_id: str - :ivar sampling_rate: The sampling rate for collection. Sampling rate 1.0 means we collect 100% - of data by default. - :vartype sampling_rate: float - """ - - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - """The msi client id used to collect logging to blob storage. If it's null,backend will pick a - registered endpoint identity to auth.""" - data_collection_mode: Optional[Union[str, "_models.DataCollectionMode"]] = rest_field( - name="dataCollectionMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable or disable data collection. Known values are: \"Enabled\" and \"Disabled\".""" - data_id: Optional[str] = rest_field(name="dataId", visibility=["read", "create", "update", "delete", "query"]) - """The data asset arm resource id. Client side will ensure data asset is pointing to the blob - storage, and backend will collect data to the blob storage.""" - sampling_rate: Optional[float] = rest_field( - name="samplingRate", visibility=["read", "create", "update", "delete", "query"] - ) - """The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data by default.""" - - @overload - def __init__( - self, - *, - client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "_models.DataCollectionMode"]] = None, - data_id: Optional[str] = None, - sampling_rate: Optional[float] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ColumnTransformer(_Model): - """Column transformer parameters. - - :ivar fields: Fields to apply transformer logic on. - :vartype fields: list[str] - :ivar parameters: Different properties to be passed to transformer. Input expected is - dictionary of key,value pairs in JSON format. - :vartype parameters: any - """ - - fields: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Fields to apply transformer logic on.""" - parameters: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Different properties to be passed to transformer. Input expected is dictionary of key,value - pairs in JSON format.""" - - @overload - def __init__( - self, - *, - fields: Optional[list[str]] = None, - parameters: Optional[Any] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CommandJob(JobBaseProperties, discriminator="Command"): - """Command job definition. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: [Required] The command to execute on startup of the job. eg. "python train.py". - Required. - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DistributionConfiguration - :ivar environment_id: [Required] The ARM resource ID of the Environment specification for the - job. Required. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput] - :ivar limits: Command Job limit. - :vartype limits: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CommandJobLimits - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutput] - :ivar parameters: Input parameters. - :vartype parameters: any - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobResourceConfiguration - :ivar job_type: [Required] Specifies the type of job. Required. COMMAND. - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.COMMAND - """ - - code_id: Optional[str] = rest_field(name="codeId", visibility=["read", "create"]) - """ARM resource ID of the code asset.""" - command: str = rest_field(visibility=["read", "create"]) - """[Required] The command to execute on startup of the job. eg. \"python train.py\". Required.""" - distribution: Optional["_models.DistributionConfiguration"] = rest_field(visibility=["read", "create"]) - """Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, - or null.""" - environment_id: str = rest_field(name="environmentId", visibility=["read", "create"]) - """[Required] The ARM resource ID of the Environment specification for the job. Required.""" - environment_variables: Optional[dict[str, str]] = rest_field( - name="environmentVariables", visibility=["read", "create"] - ) - """Environment variables included in the job.""" - inputs: Optional[dict[str, "_models.JobInput"]] = rest_field(visibility=["read", "create"]) - """Mapping of input data bindings used in the job.""" - limits: Optional["_models.CommandJobLimits"] = rest_field(visibility=["read", "create"]) - """Command Job limit.""" - outputs: Optional[dict[str, "_models.JobOutput"]] = rest_field(visibility=["read", "create"]) - """Mapping of output data bindings used in the job.""" - parameters: Optional[Any] = rest_field(visibility=["read"]) - """Input parameters.""" - queue_settings: Optional["_models.QueueSettings"] = rest_field(name="queueSettings", visibility=["read", "create"]) - """Queue settings for the job.""" - resources: Optional["_models.JobResourceConfiguration"] = rest_field(visibility=["read", "create"]) - """Compute Resource configuration for the job.""" - job_type: Literal[JobType.COMMAND] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. COMMAND.""" - - @overload - def __init__( - self, - *, - command: str, - environment_id: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - code_id: Optional[str] = None, - distribution: Optional["_models.DistributionConfiguration"] = None, - environment_variables: Optional[dict[str, str]] = None, - inputs: Optional[dict[str, "_models.JobInput"]] = None, - limits: Optional["_models.CommandJobLimits"] = None, - outputs: Optional[dict[str, "_models.JobOutput"]] = None, - queue_settings: Optional["_models.QueueSettings"] = None, - resources: Optional["_models.JobResourceConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = JobType.COMMAND # type: ignore - - -class JobLimits(_Model): - """JobLimits. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CommandJobLimits, SweepJobLimits - - :ivar job_limits_type: [Required] JobLimit type. Required. Known values are: "Command" and - "Sweep". - :vartype job_limits_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobLimitsType - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - """ - - __mapping__: dict[str, _Model] = {} - job_limits_type: str = rest_discriminator( - name="jobLimitsType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] JobLimit type. Required. Known values are: \"Command\" and \"Sweep\".""" - timeout: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports - duration with precision as low as Seconds.""" - - @overload - def __init__( - self, - *, - job_limits_type: str, - timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CommandJobLimits(JobLimits, discriminator="Command"): - """Command Job limit class. - - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar job_limits_type: [Required] JobLimit type. Required. COMMAND. - :vartype job_limits_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.COMMAND - """ - - job_limits_type: Literal[JobLimitsType.COMMAND] = rest_discriminator(name="jobLimitsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] JobLimit type. Required. COMMAND.""" - - @overload - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_limits_type = JobLimitsType.COMMAND # type: ignore - - -class ComponentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainerProperties - """ - - properties: "_models.ComponentContainerProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.ComponentContainerProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComponentContainerProperties(AssetContainer): - """Component container definition. . - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the component container. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComponentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersionProperties - """ - - properties: "_models.ComponentVersionProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.ComponentVersionProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComponentVersionProperties(AssetBase): - """Definition of a component version: defines resources that span component types. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar component_spec: Defines Component definition details. . - :vartype component_spec: any - :ivar provisioning_state: Provisioning state for the component version. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - component_spec: Optional[Any] = rest_field(name="componentSpec", visibility=["read", "create"]) - """Defines Component definition details. .""" - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the component version. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - component_spec: Optional[Any] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstance(Compute, discriminator="ComputeInstance"): - """An Azure Machine Learning compute instance. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of ComputeInstance. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceProperties - :ivar compute_type: The type of compute. Required. COMPUTE_INSTANCE. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.COMPUTE_INSTANCE - """ - - properties: Optional["_models.ComputeInstanceProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of ComputeInstance.""" - compute_type: Literal[ComputeType.COMPUTE_INSTANCE] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. COMPUTE_INSTANCE.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.ComputeInstanceProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.COMPUTE_INSTANCE # type: ignore - - -class ComputeInstanceApplication(_Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the ComputeInstance application.""" - endpoint_uri: Optional[str] = rest_field( - name="endpointUri", visibility=["read", "create", "update", "delete", "query"] - ) - """Application' endpoint URI.""" - - @overload - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceAutologgerSettings(_Model): - """Specifies settings for autologger. - - :ivar mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Known - values are: "Enabled" and "Disabled". - :vartype mlflow_autologger: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MlflowAutologger - """ - - mlflow_autologger: Optional[Union[str, "_models.MlflowAutologger"]] = rest_field( - name="mlflowAutologger", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether mlflow autologger is enabled for notebooks. Known values are: \"Enabled\" and - \"Disabled\".""" - - @overload - def __init__( - self, - *, - mlflow_autologger: Optional[Union[str, "_models.MlflowAutologger"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceConnectivityEndpoints(_Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - public_ip_address: Optional[str] = rest_field(name="publicIpAddress", visibility=["read"]) - """Public IP Address of this ComputeInstance.""" - private_ip_address: Optional[str] = rest_field(name="privateIpAddress", visibility=["read"]) - """Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is - deployed).""" - - -class ComputeInstanceContainer(_Model): - """Defines an Aml Instance container. - - :ivar name: Name of the ComputeInstance container. - :vartype name: str - :ivar autosave: Auto save settings. Known values are: "None", "Local", and "Remote". - :vartype autosave: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Autosave - :ivar gpu: Information of GPU. - :vartype gpu: str - :ivar network: network of this container. Known values are: "Bridge" and "Host". - :vartype network: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Network - :ivar environment: Environment information of this container. - :vartype environment: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceEnvironmentInfo - :ivar services: services of this containers. - :vartype services: list[any] - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the ComputeInstance container.""" - autosave: Optional[Union[str, "_models.Autosave"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Auto save settings. Known values are: \"None\", \"Local\", and \"Remote\".""" - gpu: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Information of GPU.""" - network: Optional[Union[str, "_models.Network"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """network of this container. Known values are: \"Bridge\" and \"Host\".""" - environment: Optional["_models.ComputeInstanceEnvironmentInfo"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Environment information of this container.""" - services: Optional[list[Any]] = rest_field(visibility=["read"]) - """services of this containers.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - autosave: Optional[Union[str, "_models.Autosave"]] = None, - gpu: Optional[str] = None, - network: Optional[Union[str, "_models.Network"]] = None, - environment: Optional["_models.ComputeInstanceEnvironmentInfo"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceCreatedBy(_Model): - """Describes information on user who created this ComputeInstance. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - user_name: Optional[str] = rest_field(name="userName", visibility=["read"]) - """Name of the user.""" - user_org_id: Optional[str] = rest_field(name="userOrgId", visibility=["read"]) - """Uniquely identifies user' Azure Active Directory organization.""" - user_id: Optional[str] = rest_field(name="userId", visibility=["read"]) - """Uniquely identifies the user within his/her organization.""" - - -class ComputeInstanceDataDisk(_Model): - """Defines an Aml Instance DataDisk. - - :ivar caching: Caching type of Data Disk. Known values are: "None", "ReadOnly", and - "ReadWrite". - :vartype caching: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Caching - :ivar disk_size_gb: The initial disk size in gigabytes. - :vartype disk_size_gb: int - :ivar lun: The logical unit number. - :vartype lun: int - :ivar storage_account_type: type of this storage account. Known values are: "Standard_LRS" and - "Premium_LRS". - :vartype storage_account_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StorageAccountType - """ - - caching: Optional[Union[str, "_models.Caching"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Caching type of Data Disk. Known values are: \"None\", \"ReadOnly\", and \"ReadWrite\".""" - disk_size_gb: Optional[int] = rest_field( - name="diskSizeGB", visibility=["read", "create", "update", "delete", "query"] - ) - """The initial disk size in gigabytes.""" - lun: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The logical unit number.""" - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = rest_field( - name="storageAccountType", visibility=["read", "create", "update", "delete", "query"] - ) - """type of this storage account. Known values are: \"Standard_LRS\" and \"Premium_LRS\".""" - - @overload - def __init__( - self, - *, - caching: Optional[Union[str, "_models.Caching"]] = None, - disk_size_gb: Optional[int] = None, - lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceDataMount(_Model): - """Defines an Aml Instance DataMount. - - :ivar source: Source of the ComputeInstance data mount. - :vartype source: str - :ivar source_type: Data source type. Known values are: "Dataset", "Datastore", and "URI". - :vartype source_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SourceType - :ivar mount_name: name of the ComputeInstance data mount. - :vartype mount_name: str - :ivar mount_action: Mount Action. Known values are: "Mount" and "Unmount". - :vartype mount_action: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MountAction - :ivar mount_mode: Mount Mode. Known values are: "ReadOnly" and "ReadWrite". - :vartype mount_mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MountMode - :ivar created_by: who this data mount created by. - :vartype created_by: str - :ivar mount_path: Path of this data mount. - :vartype mount_path: str - :ivar mount_state: Mount state. Known values are: "MountRequested", "Mounted", "MountFailed", - "UnmountRequested", "UnmountFailed", and "Unmounted". - :vartype mount_state: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MountState - :ivar mounted_on: Mounted time. - :vartype mounted_on: ~datetime.datetime - :ivar error: Error of this data mount. - :vartype error: str - """ - - source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Source of the ComputeInstance data mount.""" - source_type: Optional[Union[str, "_models.SourceType"]] = rest_field( - name="sourceType", visibility=["read", "create", "update", "delete", "query"] - ) - """Data source type. Known values are: \"Dataset\", \"Datastore\", and \"URI\".""" - mount_name: Optional[str] = rest_field(name="mountName", visibility=["read", "create", "update", "delete", "query"]) - """name of the ComputeInstance data mount.""" - mount_action: Optional[Union[str, "_models.MountAction"]] = rest_field( - name="mountAction", visibility=["read", "create", "update", "delete", "query"] - ) - """Mount Action. Known values are: \"Mount\" and \"Unmount\".""" - mount_mode: Optional[Union[str, "_models.MountMode"]] = rest_field( - name="mountMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Mount Mode. Known values are: \"ReadOnly\" and \"ReadWrite\".""" - created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) - """who this data mount created by.""" - mount_path: Optional[str] = rest_field(name="mountPath", visibility=["read", "create", "update", "delete", "query"]) - """Path of this data mount.""" - mount_state: Optional[Union[str, "_models.MountState"]] = rest_field( - name="mountState", visibility=["read", "create", "update", "delete", "query"] - ) - """Mount state. Known values are: \"MountRequested\", \"Mounted\", \"MountFailed\", - \"UnmountRequested\", \"UnmountFailed\", and \"Unmounted\".""" - mounted_on: Optional[datetime.datetime] = rest_field( - name="mountedOn", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Mounted time.""" - error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error of this data mount.""" - - @overload - def __init__( - self, - *, - source: Optional[str] = None, - source_type: Optional[Union[str, "_models.SourceType"]] = None, - mount_name: Optional[str] = None, - mount_action: Optional[Union[str, "_models.MountAction"]] = None, - mount_mode: Optional[Union[str, "_models.MountMode"]] = None, - created_by: Optional[str] = None, - mount_path: Optional[str] = None, - mount_state: Optional[Union[str, "_models.MountState"]] = None, - mounted_on: Optional[datetime.datetime] = None, - error: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceEnvironmentInfo(_Model): - """Environment information. - - :ivar name: name of environment. - :vartype name: str - :ivar version: version of environment. - :vartype version: str - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """name of environment.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """version of environment.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceLastOperation(_Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Known values are: "Create", "Start", "Stop", - "Restart", "Resize", "Reimage", and "Delete". - :vartype operation_name: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Known values are: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ResizeFailed", "ReimageFailed", - and "DeleteFailed". - :vartype operation_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OperationStatus - :ivar operation_trigger: Trigger of operation. Known values are: "User", "Schedule", and - "IdleShutdown". - :vartype operation_trigger: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OperationTrigger - """ - - operation_name: Optional[Union[str, "_models.OperationName"]] = rest_field( - name="operationName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the last operation. Known values are: \"Create\", \"Start\", \"Stop\", \"Restart\", - \"Resize\", \"Reimage\", and \"Delete\".""" - operation_time: Optional[datetime.datetime] = rest_field( - name="operationTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Time of the last operation.""" - operation_status: Optional[Union[str, "_models.OperationStatus"]] = rest_field( - name="operationStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Operation status. Known values are: \"InProgress\", \"Succeeded\", \"CreateFailed\", - \"StartFailed\", \"StopFailed\", \"RestartFailed\", \"ResizeFailed\", \"ReimageFailed\", and - \"DeleteFailed\".""" - operation_trigger: Optional[Union[str, "_models.OperationTrigger"]] = rest_field( - name="operationTrigger", visibility=["read", "create", "update", "delete", "query"] - ) - """Trigger of operation. Known values are: \"User\", \"Schedule\", and \"IdleShutdown\".""" - - @overload - def __init__( - self, - *, - operation_name: Optional[Union[str, "_models.OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "_models.OperationStatus"]] = None, - operation_trigger: Optional[Union[str, "_models.OperationTrigger"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceProperties(_Model): - """Compute Instance properties. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Subnet. - :vartype subnet: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResourceId - :ivar application_sharing_policy: Sharing policy for applications on this compute instance. - Known values are: "Personal" and "Shared". - :vartype application_sharing_policy: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ApplicationSharingPolicy - :ivar autologger_settings: Specifies settings for autologger. - :vartype autologger_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceAutologgerSettings - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceSshSettings - :ivar custom_services: List of Custom Services added to the compute. - :vartype custom_services: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CustomService] - :ivar os_image_metadata: Returns metadata about the operating system image for this compute - instance. - :vartype os_image_metadata: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageMetadata - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceCreatedBy - :ivar errors: Errors. - :vartype errors: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Known values are: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "Resizing", "JobRunning", "SettingUp", - "SetupFailed", "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", - "Unknown", and "Unusable". - :vartype state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceState - :ivar compute_instance_authorization_type: Compute Instance Authorization type. "personal" - :vartype compute_instance_authorization_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstancePropertiesComputeInstanceAuthorizationType - :ivar enable_os_patching: Enable Auto OS Patching. - :vartype enable_os_patching: bool - :ivar enable_root_access: Enable root access. - :vartype enable_root_access: bool - :ivar enable_sso: Enable SSO (single sign on). - :vartype enable_sso: bool - :ivar release_quota_on_stop: Release quota if compute instance stopped. - :vartype release_quota_on_stop: bool - :ivar personal_compute_instance_settings: Personal Compute Instance settings. - :vartype personal_compute_instance_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the computes. - :vartype schedules: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeSchedules - :ivar idle_time_before_shutdown: Stops compute instance after user defined period of - inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. - :vartype idle_time_before_shutdown: str - :ivar enable_node_public_ip: Enable node public IP. - :vartype enable_node_public_ip: bool - :ivar containers: Describes informations of containers on this ComputeInstance. - :vartype containers: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceContainer] - :ivar data_disks: Describes informations of dataDisks on this ComputeInstance. - :vartype data_disks: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceDataDisk] - :ivar data_mounts: Describes informations of dataMounts on this ComputeInstance. - :vartype data_mounts: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceDataMount] - :ivar versions: ComputeInstance version. - :vartype versions: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceVersion - """ - - vm_size: Optional[str] = rest_field(name="vmSize", visibility=["read", "create", "update", "delete", "query"]) - """Virtual Machine Size.""" - subnet: Optional["_models.ResourceId"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Subnet.""" - application_sharing_policy: Optional[Union[str, "_models.ApplicationSharingPolicy"]] = rest_field( - name="applicationSharingPolicy", visibility=["read", "create", "update", "delete", "query"] - ) - """Sharing policy for applications on this compute instance. Known values are: \"Personal\" and - \"Shared\".""" - autologger_settings: Optional["_models.ComputeInstanceAutologgerSettings"] = rest_field( - name="autologgerSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies settings for autologger.""" - ssh_settings: Optional["_models.ComputeInstanceSshSettings"] = rest_field( - name="sshSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies policy and settings for SSH access.""" - custom_services: Optional[list["_models.CustomService"]] = rest_field( - name="customServices", visibility=["read", "create", "update", "delete", "query"] - ) - """List of Custom Services added to the compute.""" - os_image_metadata: Optional["_models.ImageMetadata"] = rest_field(name="osImageMetadata", visibility=["read"]) - """Returns metadata about the operating system image for this compute instance.""" - connectivity_endpoints: Optional["_models.ComputeInstanceConnectivityEndpoints"] = rest_field( - name="connectivityEndpoints", visibility=["read"] - ) - """Describes all connectivity endpoints available for this ComputeInstance.""" - applications: Optional[list["_models.ComputeInstanceApplication"]] = rest_field(visibility=["read"]) - """Describes available applications and their endpoints on this ComputeInstance.""" - created_by: Optional["_models.ComputeInstanceCreatedBy"] = rest_field(name="createdBy", visibility=["read"]) - """Describes information on user who created this ComputeInstance.""" - errors: Optional[list["_models.ErrorResponse"]] = rest_field(visibility=["read"]) - """Errors.""" - state: Optional[Union[str, "_models.ComputeInstanceState"]] = rest_field(visibility=["read"]) - """The current state of this ComputeInstance. Known values are: \"Creating\", \"CreateFailed\", - \"Deleting\", \"Running\", \"Restarting\", \"Resizing\", \"JobRunning\", \"SettingUp\", - \"SetupFailed\", \"Starting\", \"Stopped\", \"Stopping\", \"UserSettingUp\", - \"UserSetupFailed\", \"Unknown\", and \"Unusable\".""" - compute_instance_authorization_type: Optional[ - Union[str, "_models.ComputeInstancePropertiesComputeInstanceAuthorizationType"] - ] = rest_field(name="computeInstanceAuthorizationType", visibility=["read", "create", "update", "delete", "query"]) - """Compute Instance Authorization type. \"personal\"""" - enable_os_patching: Optional[bool] = rest_field( - name="enableOSPatching", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable Auto OS Patching.""" - enable_root_access: Optional[bool] = rest_field( - name="enableRootAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable root access.""" - enable_sso: Optional[bool] = rest_field( - name="enableSSO", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable SSO (single sign on).""" - release_quota_on_stop: Optional[bool] = rest_field( - name="releaseQuotaOnStop", visibility=["read", "create", "update", "delete", "query"] - ) - """Release quota if compute instance stopped.""" - personal_compute_instance_settings: Optional["_models.PersonalComputeInstanceSettings"] = rest_field( - name="personalComputeInstanceSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Personal Compute Instance settings.""" - setup_scripts: Optional["_models.SetupScripts"] = rest_field( - name="setupScripts", visibility=["read", "create", "update", "delete", "query"] - ) - """Details of customized scripts to execute for setting up the cluster.""" - last_operation: Optional["_models.ComputeInstanceLastOperation"] = rest_field( - name="lastOperation", visibility=["read"] - ) - """The last operation on ComputeInstance.""" - schedules: Optional["_models.ComputeSchedules"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of schedules to be applied on the computes.""" - idle_time_before_shutdown: Optional[str] = rest_field( - name="idleTimeBeforeShutdown", visibility=["read", "create", "update", "delete", "query"] - ) - """Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 - format. Minimum is 15 min, maximum is 3 days.""" - enable_node_public_ip: Optional[bool] = rest_field( - name="enableNodePublicIp", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable node public IP.""" - containers: Optional[list["_models.ComputeInstanceContainer"]] = rest_field(visibility=["read"]) - """Describes informations of containers on this ComputeInstance.""" - data_disks: Optional[list["_models.ComputeInstanceDataDisk"]] = rest_field(name="dataDisks", visibility=["read"]) - """Describes informations of dataDisks on this ComputeInstance.""" - data_mounts: Optional[list["_models.ComputeInstanceDataMount"]] = rest_field(name="dataMounts", visibility=["read"]) - """Describes informations of dataMounts on this ComputeInstance.""" - versions: Optional["_models.ComputeInstanceVersion"] = rest_field(visibility=["read"]) - """ComputeInstance version.""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["_models.ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "_models.ApplicationSharingPolicy"]] = None, - autologger_settings: Optional["_models.ComputeInstanceAutologgerSettings"] = None, - ssh_settings: Optional["_models.ComputeInstanceSshSettings"] = None, - custom_services: Optional[list["_models.CustomService"]] = None, - compute_instance_authorization_type: Optional[ - Union[str, "_models.ComputeInstancePropertiesComputeInstanceAuthorizationType"] - ] = None, - enable_os_patching: Optional[bool] = None, - enable_root_access: Optional[bool] = None, - enable_sso: Optional[bool] = None, - release_quota_on_stop: Optional[bool] = None, - personal_compute_instance_settings: Optional["_models.PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["_models.SetupScripts"] = None, - schedules: Optional["_models.ComputeSchedules"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceSshSettings(_Model): - """Specifies policy and settings for SSH access. - - :ivar ssh_public_access: Access policy for SSH. Known values are: "Enabled" and "Disabled". - :vartype ssh_public_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - ssh_public_access: Optional[Union[str, "_models.SshPublicAccess"]] = rest_field( - name="sshPublicAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Access policy for SSH. Known values are: \"Enabled\" and \"Disabled\".""" - admin_user_name: Optional[str] = rest_field(name="adminUserName", visibility=["read"]) - """Describes the admin user name.""" - ssh_port: Optional[int] = rest_field(name="sshPort", visibility=["read"]) - """Describes the port for connecting through SSH.""" - admin_public_key: Optional[str] = rest_field( - name="adminPublicKey", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to - generate your SSH key pairs.""" - - @overload - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "_models.SshPublicAccess"]] = None, - admin_public_key: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeInstanceVersion(_Model): - """Version of computeInstance. - - :ivar runtime: Runtime of compute instance. - :vartype runtime: str - """ - - runtime: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Runtime of compute instance.""" - - @overload - def __init__( - self, - *, - runtime: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeRecurrenceSchedule(_Model): - """ComputeRecurrenceSchedule. - - :ivar hours: [Required] List of hours for the schedule. Required. - :vartype hours: list[int] - :ivar minutes: [Required] List of minutes for the schedule. Required. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeWeekDay] - """ - - hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] List of hours for the schedule. Required.""" - minutes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] List of minutes for the schedule. Required.""" - month_days: Optional[list[int]] = rest_field( - name="monthDays", visibility=["read", "create", "update", "delete", "query"] - ) - """List of month days for the schedule.""" - week_days: Optional[list[Union[str, "_models.ComputeWeekDay"]]] = rest_field( - name="weekDays", visibility=["read", "create", "update", "delete", "query"] - ) - """List of days for the schedule.""" - - @overload - def __init__( - self, - *, - hours: list[int], - minutes: list[int], - month_days: Optional[list[int]] = None, - week_days: Optional[list[Union[str, "_models.ComputeWeekDay"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeResource(ProxyResource): - """Machine Learning compute object wrapped into ARM resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Compute - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - :ivar identity: The identity of the resource. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - """ - - properties: Optional["_models.Compute"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource-specific properties for this resource.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the location of the resource.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Contains resource tags defined as key/value pairs.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sku of the workspace.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The identity of the resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.Compute"] = None, - location: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeRuntimeDto(_Model): - """ComputeRuntimeDto. - - :ivar spark_runtime_version: - :vartype spark_runtime_version: str - """ - - spark_runtime_version: Optional[str] = rest_field( - name="sparkRuntimeVersion", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeSchedules(_Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeStartStopSchedule] - """ - - compute_start_stop: Optional[list["_models.ComputeStartStopSchedule"]] = rest_field( - name="computeStartStop", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of compute start stop schedules to be applied.""" - - @overload - def __init__( - self, - *, - compute_start_stop: Optional[list["_models.ComputeStartStopSchedule"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ComputeStartStopSchedule(_Model): - """Compute start stop schedule properties. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Known values are: - "Completed", "Provisioning", and "Failed". - :vartype provisioning_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningStatus - :ivar status: Is the schedule enabled or disabled?. Known values are: "Enabled" and "Disabled". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleStatus - :ivar action: [Required] The compute power action. Known values are: "Start" and "Stop". - :vartype action: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputePowerAction - :ivar trigger_type: [Required] The schedule trigger type. Known values are: "Recurrence" and - "Cron". - :vartype trigger_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeTriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Recurrence - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Cron - :ivar schedule: [Deprecated] Not used any more. - :vartype schedule: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleBase - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """A system assigned id for the schedule.""" - provisioning_status: Optional[Union[str, "_models.ProvisioningStatus"]] = rest_field( - name="provisioningStatus", visibility=["read"] - ) - """The current deployment state of schedule. Known values are: \"Completed\", \"Provisioning\", - and \"Failed\".""" - status: Optional[Union[str, "_models.ScheduleStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is the schedule enabled or disabled?. Known values are: \"Enabled\" and \"Disabled\".""" - action: Optional[Union[str, "_models.ComputePowerAction"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The compute power action. Known values are: \"Start\" and \"Stop\".""" - trigger_type: Optional[Union[str, "_models.ComputeTriggerType"]] = rest_field( - name="triggerType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The schedule trigger type. Known values are: \"Recurrence\" and \"Cron\".""" - recurrence: Optional["_models.Recurrence"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required if triggerType is Recurrence.""" - cron: Optional["_models.Cron"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required if triggerType is Cron.""" - schedule: Optional["_models.ScheduleBase"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Deprecated] Not used any more.""" - - @overload - def __init__( - self, - *, - status: Optional[Union[str, "_models.ScheduleStatus"]] = None, - action: Optional[Union[str, "_models.ComputePowerAction"]] = None, - trigger_type: Optional[Union[str, "_models.ComputeTriggerType"]] = None, - recurrence: Optional["_models.Recurrence"] = None, - cron: Optional["_models.Cron"] = None, - schedule: Optional["_models.ScheduleBase"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ContainerResourceRequirements(_Model): - """Resource requirements for each container instance within an online deployment. - - :ivar container_resource_limits: Container resource limit info:. - :vartype container_resource_limits: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContainerResourceSettings - :ivar container_resource_requests: Container resource request info:. - :vartype container_resource_requests: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContainerResourceSettings - """ - - container_resource_limits: Optional["_models.ContainerResourceSettings"] = rest_field( - name="containerResourceLimits", visibility=["read", "create", "update", "delete", "query"] - ) - """Container resource limit info:.""" - container_resource_requests: Optional["_models.ContainerResourceSettings"] = rest_field( - name="containerResourceRequests", visibility=["read", "create", "update", "delete", "query"] - ) - """Container resource request info:.""" - - @overload - def __init__( - self, - *, - container_resource_limits: Optional["_models.ContainerResourceSettings"] = None, - container_resource_requests: Optional["_models.ContainerResourceSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ContainerResourceSettings(_Model): - """ContainerResourceSettings. - - :ivar cpu: Number of vCPUs request/limit for container. More info: - `https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - `_. - :vartype cpu: str - :ivar gpu: Number of Nvidia GPU cards request/limit for container. More info: - `https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - `_. - :vartype gpu: str - :ivar memory: Memory size request/limit for container. More info: - `https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - `_. - :vartype memory: str - """ - - cpu: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of vCPUs request/limit for container. More info: - `https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - `_.""" - gpu: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of Nvidia GPU cards request/limit for container. More info: - `https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - `_.""" - memory: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Memory size request/limit for container. More info: - `https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - `_.""" - - @overload - def __init__( - self, - *, - cpu: Optional[str] = None, - gpu: Optional[str] = None, - memory: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ContentSafety(_Model): - """ContentSafety. - - :ivar content_safety_level: Specifies the current safety level for content safety. Known values - are: "Blocking" and "Deferred". - :vartype content_safety_level: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContentSafetyLevel - :ivar content_safety_status: [Required] Specifies the status of content safety. Required. Known - values are: "Enabled" and "Disabled". - :vartype content_safety_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContentSafetyStatus - """ - - content_safety_level: Optional[Union[str, "_models.ContentSafetyLevel"]] = rest_field( - name="contentSafetyLevel", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the current safety level for content safety. Known values are: \"Blocking\" and - \"Deferred\".""" - content_safety_status: Union[str, "_models.ContentSafetyStatus"] = rest_field( - name="contentSafetyStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Specifies the status of content safety. Required. Known values are: \"Enabled\" and - \"Disabled\".""" - - @overload - def __init__( - self, - *, - content_safety_status: Union[str, "_models.ContentSafetyStatus"], - content_safety_level: Optional[Union[str, "_models.ContentSafetyLevel"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointDeploymentResourceProperties(_Model): - """EndpointDeploymentResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContentSafetyEndpointDeploymentResourceProperties, OpenAIEndpointDeploymentResourceProperties, - SpeechEndpointDeploymentResourceProperties, ManagedOnlineEndpointDeploymentResourceProperties - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar type: Kind of the deployment. Required. Default value is None. - :vartype type: str - """ - - __mapping__: dict[str, _Model] = {} - failure_reason: Optional[str] = rest_field( - name="failureReason", visibility=["read", "create", "update", "delete", "query"] - ) - """The failure reason if the creation failed.""" - provisioning_state: Optional[Union[str, "_models.DefaultResourceProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Read-only provision state status property. Known values are: \"NotStarted\", \"Failed\", - \"Creating\", \"Updating\", \"Succeeded\", \"Deleting\", \"Accepted\", \"Canceled\", - \"Scaling\", and \"Disabled\".""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Kind of the deployment. Required. Default value is None.""" - - @overload - def __init__( - self, - *, - type: str, - failure_reason: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ContentSafetyEndpointDeploymentResourceProperties( - EndpointDeploymentResourceProperties, discriminator="Azure.ContentSafety" -): # pylint: disable=name-too-long - """ContentSafetyEndpointDeploymentResourceProperties. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar model: Model used for the endpoint deployment. Required. - :vartype model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Known values are: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", and "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentModelVersionUpgradeOption - :ivar type: Kind of the deployment. Required. Default value is "Azure.ContentSafety". - :vartype type: str - """ - - model: "_models.EndpointDeploymentModel" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model used for the endpoint deployment. Required.""" - rai_policy_name: Optional[str] = rest_field( - name="raiPolicyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of RAI policy.""" - sku: Optional["_models.CognitiveServicesSku"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = rest_field( - name="versionUpgradeOption", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment model version upgrade option. Known values are: \"OnceNewDefaultVersionAvailable\", - \"OnceCurrentVersionExpired\", and \"NoAutoUpgrade\".""" - type: Literal["Azure.ContentSafety"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Kind of the deployment. Required. Default value is \"Azure.ContentSafety\".""" - - @overload - def __init__( - self, - *, - model: "_models.EndpointDeploymentModel", - failure_reason: Optional[str] = None, - rai_policy_name: Optional[str] = None, - sku: Optional["_models.CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = "Azure.ContentSafety" # type: ignore - - -class EndpointResourceProperties(_Model): - """EndpointResourceProperties. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContentSafetyEndpointResourceProperties, OpenAIEndpointResourceProperties, - SpeechEndpointResourceProperties, ManagedOnlineEndpointResourceProperties, - ServerlessEndpointResourceProperties - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_type: Type of the endpoint. Required. Known values are: "Azure.OpenAI", - "Azure.Speech", "Azure.ContentSafety", "Azure.Llama", "managedOnlineEndpoint", and - "serverlessEndpoint". - :vartype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointType - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. Since input dto and when parse endpoint resource - share the same contract this Location field is just for parse the endpoint resource info we - won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - """ - - __mapping__: dict[str, _Model] = {} - associated_resource_id: Optional[str] = rest_field( - name="associatedResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Byo resource id for creating the built-in model service endpoints.""" - deployments: Optional[list["_models.EndpointDeploymentResourcePropertiesBasicResource"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deployments info.""" - endpoint_type: str = rest_discriminator( - name="endpointType", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of the endpoint. Required. Known values are: \"Azure.OpenAI\", \"Azure.Speech\", - \"Azure.ContentSafety\", \"Azure.Llama\", \"managedOnlineEndpoint\", and - \"serverlessEndpoint\".""" - endpoint_uri: Optional[str] = rest_field( - name="endpointUri", visibility=["read", "create", "update", "delete", "query"] - ) - """Uri of the endpoint.""" - failure_reason: Optional[str] = rest_field( - name="failureReason", visibility=["read", "create", "update", "delete", "query"] - ) - """The failure reason if the creation failed.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Location of the endpoint. Since input dto and when parse endpoint resource share the same - contract this Location field is just for parse the endpoint resource info we won't let customer - specify the endpoint resource location since we will create it the same location as workspace.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the endpoint.""" - provisioning_state: Optional[Union[str, "_models.DefaultResourceProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Read-only provision state status property. Known values are: \"NotStarted\", \"Failed\", - \"Creating\", \"Updating\", \"Succeeded\", \"Deleting\", \"Accepted\", \"Canceled\", - \"Scaling\", and \"Disabled\".""" - should_create_ai_services_endpoint: Optional[bool] = rest_field( - name="shouldCreateAiServicesEndpoint", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account - endpoint.""" - - @overload - def __init__( - self, - *, - endpoint_type: str, - associated_resource_id: Optional[str] = None, - deployments: Optional[list["_models.EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ContentSafetyEndpointResourceProperties(EndpointResourceProperties, discriminator="Azure.ContentSafety"): - """ContentSafetyEndpointResourceProperties. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. Since input dto and when parse endpoint resource - share the same contract this Location field is just for parse the endpoint resource info we - won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar endpoint_type: Type of the endpoint. Required. AZURE_CONTENT_SAFETY. - :vartype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_CONTENT_SAFETY - """ - - endpoint_type: Literal[EndpointType.AZURE_CONTENT_SAFETY] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of the endpoint. Required. AZURE_CONTENT_SAFETY.""" - - @overload - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[list["_models.EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.endpoint_type = EndpointType.AZURE_CONTENT_SAFETY # type: ignore - - -class CosmosDbSettings(_Model): - """CosmosDbSettings. - - :ivar collections_throughput: - :vartype collections_throughput: int - """ - - collections_throughput: Optional[int] = rest_field( - name="collectionsThroughput", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ScheduleActionBase(_Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - JobScheduleAction, CreateMonitorAction, EndpointScheduleAction - - :ivar action_type: [Required] Specifies the action type of the schedule. Required. Known values - are: "CreateJob", "InvokeBatchEndpoint", and "CreateMonitor". - :vartype action_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleActionType - """ - - __mapping__: dict[str, _Model] = {} - action_type: str = rest_discriminator(name="actionType", visibility=["read", "create", "update"]) - """[Required] Specifies the action type of the schedule. Required. Known values are: - \"CreateJob\", \"InvokeBatchEndpoint\", and \"CreateMonitor\".""" - - @overload - def __init__( - self, - *, - action_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CreateMonitorAction(ScheduleActionBase, discriminator="CreateMonitor"): - """CreateMonitorAction. - - :ivar monitor_definition: [Required] Defines the monitor. Required. - :vartype monitor_definition: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitorDefinition - :ivar action_type: [Required] Specifies the action type of the schedule. Required. - CREATE_MONITOR. - :vartype action_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CREATE_MONITOR - """ - - monitor_definition: "_models.MonitorDefinition" = rest_field( - name="monitorDefinition", visibility=["read", "create"] - ) - """[Required] Defines the monitor. Required.""" - action_type: Literal[ScheduleActionType.CREATE_MONITOR] = rest_discriminator(name="actionType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the action type of the schedule. Required. CREATE_MONITOR.""" - - @overload - def __init__( - self, - *, - monitor_definition: "_models.MonitorDefinition", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.action_type = ScheduleActionType.CREATE_MONITOR # type: ignore - - -class Cron(_Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows - time zone format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. The expression should - follow NCronTab format. - :vartype expression: str - """ - - start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) - """The start time in yyyy-MM-ddTHH:mm:ss format.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone - format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_.""" - expression: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Specifies cron expression of schedule. The expression should follow NCronTab format.""" - - @overload - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = None, - expression: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TriggerBase(_Model): - """TriggerBase. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CronTrigger, RecurrenceTrigger - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - `https://en.wikipedia.org/wiki/ISO_8601 `_. Recommented - format would be "2022-06-01T00:00:01" If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows - time zone format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_. - :vartype time_zone: str - :ivar trigger_type: [Required]. Required. Known values are: "Recurrence" and "Cron". - :vartype trigger_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TriggerType - """ - - __mapping__: dict[str, _Model] = {} - end_time: Optional[str] = rest_field(name="endTime", visibility=["read", "create", "update", "delete", "query"]) - """Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - `https://en.wikipedia.org/wiki/ISO_8601 `_. Recommented - format would be \"2022-06-01T00:00:01\" If not present, the schedule will run indefinitely.""" - start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) - """Specifies start time of schedule in ISO 8601 format, but without a UTC offset.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone - format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_.""" - trigger_type: str = rest_discriminator(name="triggerType", visibility=["read", "create", "update"]) - """[Required]. Required. Known values are: \"Recurrence\" and \"Cron\".""" - - @overload - def __init__( - self, - *, - trigger_type: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CronTrigger(TriggerBase, discriminator="Cron"): - """CronTrigger. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - `https://en.wikipedia.org/wiki/ISO_8601 `_. Recommented - format would be "2022-06-01T00:00:01" If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows - time zone format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_. - :vartype time_zone: str - :ivar expression: [Required] Specifies cron expression of schedule. The expression should - follow NCronTab format. Required. - :vartype expression: str - :ivar trigger_type: [Required]. Required. CRON. - :vartype trigger_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CRON - """ - - expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Specifies cron expression of schedule. The expression should follow NCronTab format. - Required.""" - trigger_type: Literal[TriggerType.CRON] = rest_discriminator(name="triggerType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required]. Required. CRON.""" - - @overload - def __init__( - self, - *, - expression: str, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.trigger_type = TriggerType.CRON # type: ignore - - -class CustomForecastHorizon(ForecastHorizon, discriminator="Custom"): - """The desired maximum forecast horizon in units of time-series frequency. - - :ivar value: [Required] Forecast horizon value. Required. - :vartype value: int - :ivar mode: [Required] Set forecast horizon value selection mode. Required. Use the custom - forecast horizon. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM - """ - - value: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Forecast horizon value. Required.""" - mode: Literal[ForecastHorizonMode.CUSTOM] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Set forecast horizon value selection mode. Required. Use the custom forecast - horizon.""" - - @overload - def __init__( - self, - *, - value: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = ForecastHorizonMode.CUSTOM # type: ignore - - -class CustomKeys(_Model): - """Custom Keys credential object. - - :ivar keys_property: - :vartype keys_property: dict[str, str] - """ - - keys_property: Optional[dict[str, str]] = rest_field( - name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" - ) - - @overload - def __init__( - self, - *, - keys_property: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CustomKeysWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2, discriminator="CustomKeys"): - """Category:= CustomKeys AuthType:= CustomKeys (as type discriminator) Credentials:= {CustomKeys} - as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any - value} Use Metadata property bag for ApiVersion and other metadata fields. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CustomKeys - :ivar auth_type: Authentication type of the connection target. Required. CUSTOM_KEYS. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM_KEYS - """ - - credentials: Optional["_models.CustomKeys"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Custom Keys credential object.""" - auth_type: Literal[ConnectionAuthType.CUSTOM_KEYS] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. CUSTOM_KEYS.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.CustomKeys"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.CUSTOM_KEYS # type: ignore - - -class CustomMetricThreshold(_Model): - """CustomMetricThreshold. - - :ivar metric: [Required] The user-defined metric to calculate. Required. - :vartype metric: str - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - """ - - metric: str = rest_field(visibility=["read", "create"]) - """[Required] The user-defined metric to calculate. Required.""" - threshold: Optional["_models.MonitoringThreshold"] = rest_field(visibility=["read", "create"]) - """The threshold value. If null, a default value will be set depending on the selected metric.""" - - @overload - def __init__( - self, - *, - metric: str, - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CustomModelFineTuning(FineTuningVertical, discriminator="Custom"): - """CustomModelFineTuning. - - :ivar model: [Required] Input model for fine tuning. Required. - :vartype model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar task_type: [Required] Fine tuning task type. Required. Known values are: - "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", - "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", - "ImageInstanceSegmentation", "ImageObjectDetection", and "VideoMultiObjectTracking". - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FineTuningTaskType - :ivar training_data: [Required] Training data for fine tuning. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar hyper_parameters: HyperParameters for fine tuning custom model. - :vartype hyper_parameters: dict[str, str] - :ivar model_provider: [Required] Enum to determine the type of fine tuning. Required. Fine - tuning using custom model. - :vartype model_provider: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM - """ - - hyper_parameters: Optional[dict[str, str]] = rest_field( - name="hyperParameters", visibility=["read", "create", "update", "delete", "query"] - ) - """HyperParameters for fine tuning custom model.""" - model_provider: Literal[ModelProvider.CUSTOM] = rest_discriminator(name="modelProvider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Enum to determine the type of fine tuning. Required. Fine tuning using custom model.""" - - @overload - def __init__( - self, - *, - model: "_models.JobInput", - task_type: Union[str, "_models.FineTuningTaskType"], - training_data: "_models.JobInput", - validation_data: Optional["_models.JobInput"] = None, - hyper_parameters: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.model_provider = ModelProvider.CUSTOM # type: ignore - - -class JobInput(_Model): - """Command job definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomModelJobInput, LiteralJobInput, MLFlowModelJobInput, MLTableJobInput, - TritonModelJobInput, UriFileJobInput, UriFolderJobInput - - :ivar description: Description for the input. - :vartype description: str - :ivar job_input_type: [Required] Specifies the type of job. Required. Known values are: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", and - "triton_model". - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInputType - """ - - __mapping__: dict[str, _Model] = {} - description: Optional[str] = rest_field(visibility=["read", "create"]) - """Description for the input.""" - job_input_type: str = rest_discriminator(name="jobInputType", visibility=["read", "create"]) - """[Required] Specifies the type of job. Required. Known values are: \"literal\", \"uri_file\", - \"uri_folder\", \"mltable\", \"custom_model\", \"mlflow_model\", and \"triton_model\".""" - - @overload - def __init__( - self, - *, - job_input_type: str, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CustomModelJobInput(JobInput, discriminator="custom_model"): - """CustomModelJobInput. - - :ivar description: Description for the input. - :vartype description: str - :ivar mode: Enum to determine the input data delivery mode. Known values are: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", and "EvalDownload". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InputDeliveryMode - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar job_input_type: [Required] Specifies the type of job. Required. CUSTOM_MODEL. - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM_MODEL - """ - - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Enum to determine the input data delivery mode. Known values are: \"ReadOnlyMount\", - \"ReadWriteMount\", \"Download\", \"Direct\", \"EvalMount\", and \"EvalDownload\".""" - uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Input Asset URI. Required.""" - job_input_type: Literal[JobInputType.CUSTOM_MODEL] = rest_discriminator(name="jobInputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. CUSTOM_MODEL.""" - - @overload - def __init__( - self, - *, - uri: str, - description: Optional[str] = None, - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_input_type = JobInputType.CUSTOM_MODEL # type: ignore - - -class JobOutput(_Model): - """Job output definition container information on where to find job output/logs. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomModelJobOutput, MLFlowModelJobOutput, MLTableJobOutput, TritonModelJobOutput, - UriFileJobOutput, UriFolderJobOutput - - :ivar description: Description for the output. - :vartype description: str - :ivar job_output_type: [Required] Specifies the type of job. Required. Known values are: - "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", and "triton_model". - :vartype job_output_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutputType - """ - - __mapping__: dict[str, _Model] = {} - description: Optional[str] = rest_field(visibility=["read", "create"]) - """Description for the output.""" - job_output_type: str = rest_discriminator(name="jobOutputType", visibility=["read", "create"]) - """[Required] Specifies the type of job. Required. Known values are: \"uri_file\", \"uri_folder\", - \"mltable\", \"custom_model\", \"mlflow_model\", and \"triton_model\".""" - - @overload - def __init__( - self, - *, - job_output_type: str, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CustomModelJobOutput(JobOutput, discriminator="custom_model"): - """CustomModelJobOutput. - - :ivar description: Description for the output. - :vartype description: str - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output data delivery mode enums. Known values are: "ReadWriteMount", "Upload", and - "Direct". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar job_output_type: [Required] Specifies the type of job. Required. CUSTOM_MODEL. - :vartype job_output_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM_MODEL - """ - - asset_name: Optional[str] = rest_field(name="assetName", visibility=["read", "create", "update", "delete", "query"]) - """Output Asset Name.""" - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Output data delivery mode enums. Known values are: \"ReadWriteMount\", \"Upload\", and - \"Direct\".""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Output Asset URI.""" - job_output_type: Literal[JobOutputType.CUSTOM_MODEL] = rest_discriminator(name="jobOutputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. CUSTOM_MODEL.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_output_type = JobOutputType.CUSTOM_MODEL # type: ignore - - -class MonitoringSignalBase(_Model): - """MonitoringSignalBase. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomMonitoringSignal, DataDriftMonitoringSignal, DataQualityMonitoringSignal, - FeatureAttributionDriftMonitoringSignal, PredictionDriftMonitoringSignal - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar signal_type: [Required] Specifies the type of signal to monitor. Required. Known values - are: "DataDrift", "PredictionDrift", "DataQuality", "FeatureAttributionDrift", and "Custom". - :vartype signal_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringSignalType - """ - - __mapping__: dict[str, _Model] = {} - notification_types: Optional[list[Union[str, "_models.MonitoringNotificationType"]]] = rest_field( - name="notificationTypes", visibility=["read", "create"] - ) - """The current notification mode for this signal.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Property dictionary. Properties can be added, but not removed or altered.""" - signal_type: str = rest_discriminator(name="signalType", visibility=["read", "create"]) - """[Required] Specifies the type of signal to monitor. Required. Known values are: \"DataDrift\", - \"PredictionDrift\", \"DataQuality\", \"FeatureAttributionDrift\", and \"Custom\".""" - - @overload - def __init__( - self, - *, - signal_type: str, - notification_types: Optional[list[Union[str, "_models.MonitoringNotificationType"]]] = None, - properties: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CustomMonitoringSignal(MonitoringSignalBase, discriminator="Custom"): - """CustomMonitoringSignal. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar component_id: [Required] Reference to the component asset used to calculate the custom - metrics. Required. - :vartype component_id: str - :ivar input_assets: Monitoring assets to take as input. Key is the component input port name, - value is the data asset. - :vartype input_assets: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase] - :ivar inputs: Extra component parameters to take as input. Key is the component literal input - port name, value is the parameter value. - :vartype inputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput] - :ivar metric_thresholds: [Required] A list of metrics to calculate and their associated - thresholds. Required. - :vartype metric_thresholds: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CustomMetricThreshold] - :ivar signal_type: [Required] Specifies the type of signal to monitor. Required. Tracks a - custom signal provided by users. - :vartype signal_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM - """ - - component_id: str = rest_field(name="componentId", visibility=["read", "create"]) - """[Required] Reference to the component asset used to calculate the custom metrics. Required.""" - input_assets: Optional[dict[str, "_models.MonitoringInputDataBase"]] = rest_field( - name="inputAssets", visibility=["read", "create"] - ) - """Monitoring assets to take as input. Key is the component input port name, value is the data - asset.""" - inputs: Optional[dict[str, "_models.JobInput"]] = rest_field(visibility=["read", "create"]) - """Extra component parameters to take as input. Key is the component literal input port name, - value is the parameter value.""" - metric_thresholds: list["_models.CustomMetricThreshold"] = rest_field( - name="metricThresholds", visibility=["read", "create"] - ) - """[Required] A list of metrics to calculate and their associated thresholds. Required.""" - signal_type: Literal[MonitoringSignalType.CUSTOM] = rest_discriminator(name="signalType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. Tracks a custom signal provided - by users.""" - - @overload - def __init__( - self, - *, - component_id: str, - metric_thresholds: list["_models.CustomMetricThreshold"], - notification_types: Optional[list[Union[str, "_models.MonitoringNotificationType"]]] = None, - properties: Optional[dict[str, str]] = None, - input_assets: Optional[dict[str, "_models.MonitoringInputDataBase"]] = None, - inputs: Optional[dict[str, "_models.JobInput"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.signal_type = MonitoringSignalType.CUSTOM # type: ignore - - -class CustomNCrossValidations(NCrossValidations, discriminator="Custom"): - """N-Cross validations are specified by user. - - :ivar value: [Required] N-Cross validations value. Required. - :vartype value: int - :ivar mode: [Required] Mode for determining N-Cross validations. Required. Use custom N-Cross - validations value. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM - """ - - value: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] N-Cross validations value. Required.""" - mode: Literal[NCrossValidationsMode.CUSTOM] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Mode for determining N-Cross validations. Required. Use custom N-Cross validations - value.""" - - @overload - def __init__( - self, - *, - value: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = NCrossValidationsMode.CUSTOM # type: ignore - - -class CustomSeasonality(Seasonality, discriminator="Custom"): - """CustomSeasonality. - - :ivar value: [Required] Seasonality value. Required. - :vartype value: int - :ivar mode: [Required] Seasonality mode. Required. Use the custom seasonality value. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM - """ - - value: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Seasonality value. Required.""" - mode: Literal[SeasonalityMode.CUSTOM] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Seasonality mode. Required. Use the custom seasonality value.""" - - @overload - def __init__( - self, - *, - value: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = SeasonalityMode.CUSTOM # type: ignore - - -class CustomService(_Model): - """Specifies the custom service configuration. - - :ivar name: Name of the Custom Service. - :vartype name: str - :ivar image: Describes the Image Specifications. - :vartype image: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Image - :ivar environment_variables: Environment Variable for the container. - :vartype environment_variables: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVariable] - :ivar docker: Describes the docker settings for the image. - :vartype docker: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Docker - :ivar endpoints: Configuring the endpoints for the container. - :vartype endpoints: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Endpoint] - :ivar volumes: Configuring the volumes for the container. - :vartype volumes: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VolumeDefinition] - :ivar kernel: Describes the jupyter kernel settings for the image if its a custom environment. - :vartype kernel: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JupyterKernelConfig - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Custom Service.""" - image: Optional["_models.Image"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Describes the Image Specifications.""" - environment_variables: Optional[dict[str, "_models.EnvironmentVariable"]] = rest_field( - name="environmentVariables", visibility=["read", "create", "update", "delete", "query"] - ) - """Environment Variable for the container.""" - docker: Optional["_models.Docker"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Describes the docker settings for the image.""" - endpoints: Optional[list["_models.Endpoint"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuring the endpoints for the container.""" - volumes: Optional[list["_models.VolumeDefinition"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuring the volumes for the container.""" - kernel: Optional["_models.JupyterKernelConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Describes the jupyter kernel settings for the image if its a custom environment.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - image: Optional["_models.Image"] = None, - environment_variables: Optional[dict[str, "_models.EnvironmentVariable"]] = None, - docker: Optional["_models.Docker"] = None, - endpoints: Optional[list["_models.Endpoint"]] = None, - volumes: Optional[list["_models.VolumeDefinition"]] = None, - kernel: Optional["_models.JupyterKernelConfig"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CustomTargetLags(TargetLags, discriminator="Custom"): - """CustomTargetLags. - - :ivar values_property: [Required] Set target lags values. Required. - :vartype values_property: list[int] - :ivar mode: [Required] Set target lags mode - Auto/Custom. Required. Use the custom target - lags. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM - """ - - values_property: list[int] = rest_field( - name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" - ) - """[Required] Set target lags values. Required.""" - mode: Literal[TargetLagsMode.CUSTOM] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Set target lags mode - Auto/Custom. Required. Use the custom target lags.""" - - @overload - def __init__( - self, - *, - values_property: list[int], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = TargetLagsMode.CUSTOM # type: ignore - - -class CustomTargetRollingWindowSize(TargetRollingWindowSize, discriminator="Custom"): - """CustomTargetRollingWindowSize. - - :ivar value: [Required] TargetRollingWindowSize value. Required. - :vartype value: int - :ivar mode: [Required] TargetRollingWindowSiz detection mode. Required. Use the specified - rolling window size. - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CUSTOM - """ - - value: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] TargetRollingWindowSize value. Required.""" - mode: Literal[TargetRollingWindowSizeMode.CUSTOM] = rest_discriminator(name="mode", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] TargetRollingWindowSiz detection mode. Required. Use the specified rolling window - size.""" - - @overload - def __init__( - self, - *, - value: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.mode = TargetRollingWindowSizeMode.CUSTOM # type: ignore - - -class Databricks(Compute, discriminator="Databricks"): - """A DataFactory compute. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatabricksProperties - :ivar compute_type: The type of compute. Required. DATABRICKS. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DATABRICKS - """ - - properties: Optional["_models.DatabricksProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - compute_type: Literal[ComputeType.DATABRICKS] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. DATABRICKS.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.DatabricksProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.DATABRICKS # type: ignore - - -class DatabricksComputeSecrets(ComputeSecrets, discriminator="Databricks"): - """Secrets related to a Machine Learning compute based on Databricks. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: The type of compute. Required. DATABRICKS. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DATABRICKS - """ - - databricks_access_token: Optional[str] = rest_field( - name="databricksAccessToken", visibility=["read", "create", "update", "delete", "query"] - ) - """access token for databricks account.""" - compute_type: Literal[ComputeType.DATABRICKS] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. DATABRICKS.""" - - @overload - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.DATABRICKS # type: ignore - - -class DatabricksProperties(_Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - databricks_access_token: Optional[str] = rest_field( - name="databricksAccessToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Databricks access token.""" - workspace_url: Optional[str] = rest_field( - name="workspaceUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Workspace Url.""" - - @overload - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataCollector(_Model): - """DataCollector. - - :ivar collections: [Required] The collection configuration. Each collection has it own - configuration to collect model data and the name of collection can be arbitrary string. Model - data collector can be used for either payload logging or custom logging or both of them. - Collection request and response are reserved for payload logging, others are for custom - logging. Required. - :vartype collections: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Collection] - :ivar request_logging: The request logging configuration for mdc, it includes advanced logging - settings for all collections. It's optional. - :vartype request_logging: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RequestLogging - :ivar rolling_rate: When model data is collected to blob storage, we need to roll the data to - different path to avoid logging all of them in a single blob file. If the rolling rate is hour, - all data will be collected in the blob path /yyyy/MM/dd/HH/. If it's day, all data will be - collected in blob path /yyyy/MM/dd/. The other benefit of rolling path is that model monitoring - ui is able to select a time range of data very quickly. Known values are: "Year", "Month", - "Day", "Hour", and "Minute". - :vartype rolling_rate: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RollingRateType - """ - - collections: dict[str, "_models.Collection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The collection configuration. Each collection has it own configuration to collect - model data and the name of collection can be arbitrary string. Model data collector can be used - for either payload logging or custom logging or both of them. Collection request and response - are reserved for payload logging, others are for custom logging. Required.""" - request_logging: Optional["_models.RequestLogging"] = rest_field( - name="requestLogging", visibility=["read", "create", "update", "delete", "query"] - ) - """The request logging configuration for mdc, it includes advanced logging settings for all - collections. It's optional.""" - rolling_rate: Optional[Union[str, "_models.RollingRateType"]] = rest_field( - name="rollingRate", visibility=["read", "create", "update", "delete", "query"] - ) - """When model data is collected to blob storage, we need to roll the data to different path to - avoid logging all of them in a single blob file. If the rolling rate is hour, all data will be - collected in the blob path /yyyy/MM/dd/HH/. If it's day, all data will be collected in blob - path /yyyy/MM/dd/. The other benefit of rolling path is that model monitoring ui is able to - select a time range of data very quickly. Known values are: \"Year\", \"Month\", \"Day\", - \"Hour\", and \"Minute\".""" - - @overload - def __init__( - self, - *, - collections: dict[str, "_models.Collection"], - request_logging: Optional["_models.RequestLogging"] = None, - rolling_rate: Optional[Union[str, "_models.RollingRateType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainerProperties - """ - - properties: "_models.DataContainerProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.DataContainerProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataContainerProperties(AssetContainer): - """Container for data asset versions. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar data_type: [Required] Specifies the type of data. Required. Known values are: "uri_file", - "uri_folder", and "mltable". - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataType - """ - - data_type: Union[str, "_models.DataType"] = rest_field(name="dataType", visibility=["read", "create"]) - """[Required] Specifies the type of data. Required. Known values are: \"uri_file\", - \"uri_folder\", and \"mltable\".""" - - @overload - def __init__( - self, - *, - data_type: Union[str, "_models.DataType"], - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataDriftMonitoringSignal(MonitoringSignalBase, discriminator="DataDrift"): - """DataDriftMonitoringSignal. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureImportanceSettings - :ivar features: The feature filter which identifies which feature to calculate drift over. - :vartype features: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: [Required] A list of metrics to calculate and their associated - thresholds. Required. - :vartype metric_thresholds: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataDriftMetricThresholdBase] - :ivar production_data: [Required] The data which drift will be calculated for. Required. - :vartype production_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase - :ivar reference_data: [Required] The data to calculate drift against. Required. - :vartype reference_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase - :ivar signal_type: [Required] Specifies the type of signal to monitor. Required. Tracks model - input data distribution change, comparing against training data or past production data. - :vartype signal_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DATA_DRIFT - """ - - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = rest_field( - name="featureDataTypeOverride", visibility=["read", "create"] - ) - """A dictionary that maps feature names to their respective data types.""" - feature_importance_settings: Optional["_models.FeatureImportanceSettings"] = rest_field( - name="featureImportanceSettings", visibility=["read", "create"] - ) - """The settings for computing feature importance.""" - features: Optional["_models.MonitoringFeatureFilterBase"] = rest_field(visibility=["read", "create"]) - """The feature filter which identifies which feature to calculate drift over.""" - metric_thresholds: list["_models.DataDriftMetricThresholdBase"] = rest_field( - name="metricThresholds", visibility=["read", "create"] - ) - """[Required] A list of metrics to calculate and their associated thresholds. Required.""" - production_data: "_models.MonitoringInputDataBase" = rest_field( - name="productionData", visibility=["read", "create"] - ) - """[Required] The data which drift will be calculated for. Required.""" - reference_data: "_models.MonitoringInputDataBase" = rest_field(name="referenceData", visibility=["read", "create"]) - """[Required] The data to calculate drift against. Required.""" - signal_type: Literal[MonitoringSignalType.DATA_DRIFT] = rest_discriminator(name="signalType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. Tracks model input data - distribution change, comparing against training data or past production data.""" - - @overload - def __init__( - self, - *, - metric_thresholds: list["_models.DataDriftMetricThresholdBase"], - production_data: "_models.MonitoringInputDataBase", - reference_data: "_models.MonitoringInputDataBase", - notification_types: Optional[list[Union[str, "_models.MonitoringNotificationType"]]] = None, - properties: Optional[dict[str, str]] = None, - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["_models.FeatureImportanceSettings"] = None, - features: Optional["_models.MonitoringFeatureFilterBase"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.signal_type = MonitoringSignalType.DATA_DRIFT # type: ignore - - -class DataFactory(Compute, discriminator="DataFactory"): - """A DataFactory compute. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar compute_type: The type of compute. Required. DATA_FACTORY. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DATA_FACTORY - """ - - compute_type: Literal[ComputeType.DATA_FACTORY] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. DATA_FACTORY.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.DATA_FACTORY # type: ignore - - -class DataGenerationVertical(_Model): - """DataGenerationVertical. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - LabelGeneration - - :ivar data_generation_task_type: [Required] DataGeneration Task type. Required. Known values - are: "Conversation", "Math", "Nli", "NluQa", and "Summarization". - :vartype data_generation_task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataGenerationTaskType - :ivar data_generation_type: [Required] Enum to determine the type of Data Generation. Required. - Known values are: "LabelGeneration" and "DataGeneration". - :vartype data_generation_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataGenerationType - :ivar prompt_settings: Prompt Settings. - :vartype prompt_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PromptSettings - :ivar teacher_model_endpoint: [Required] Teacher Model Endpoint Details. Required. - :vartype teacher_model_endpoint: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TeacherModelEndpoint - :ivar teacher_model_settings: - :vartype teacher_model_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TeacherModelSettings - """ - - __mapping__: dict[str, _Model] = {} - data_generation_task_type: Union[str, "_models.DataGenerationTaskType"] = rest_field( - name="dataGenerationTaskType", visibility=["read", "create"] - ) - """[Required] DataGeneration Task type. Required. Known values are: \"Conversation\", \"Math\", - \"Nli\", \"NluQa\", and \"Summarization\".""" - data_generation_type: str = rest_discriminator(name="dataGenerationType", visibility=["read", "create"]) - """[Required] Enum to determine the type of Data Generation. Required. Known values are: - \"LabelGeneration\" and \"DataGeneration\".""" - prompt_settings: Optional["_models.PromptSettings"] = rest_field( - name="promptSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Prompt Settings.""" - teacher_model_endpoint: "_models.TeacherModelEndpoint" = rest_field( - name="teacherModelEndpoint", visibility=["read", "create"] - ) - """[Required] Teacher Model Endpoint Details. Required.""" - teacher_model_settings: Optional["_models.TeacherModelSettings"] = rest_field( - name="teacherModelSettings", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - data_generation_task_type: Union[str, "_models.DataGenerationTaskType"], - data_generation_type: str, - teacher_model_endpoint: "_models.TeacherModelEndpoint", - prompt_settings: Optional["_models.PromptSettings"] = None, - teacher_model_settings: Optional["_models.TeacherModelSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataLakeAnalytics(Compute, discriminator="DataLakeAnalytics"): - """A DataLakeAnalytics compute. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataLakeAnalyticsSchemaProperties - :ivar compute_type: The type of compute. Required. DATA_LAKE_ANALYTICS. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DATA_LAKE_ANALYTICS - """ - - properties: Optional["_models.DataLakeAnalyticsSchemaProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - compute_type: Literal[ComputeType.DATA_LAKE_ANALYTICS] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. DATA_LAKE_ANALYTICS.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.DataLakeAnalyticsSchemaProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.DATA_LAKE_ANALYTICS # type: ignore - - -class DataLakeAnalyticsSchemaProperties(_Model): - """DataLakeAnalyticsSchemaProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - data_lake_store_account_name: Optional[str] = rest_field( - name="dataLakeStoreAccountName", visibility=["read", "create", "update", "delete", "query"] - ) - """DataLake Store Account Name.""" - - @overload - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataPathAssetReference(AssetReferenceBase, discriminator="DataPath"): - """Reference to an asset via its path in a datastore. - - :ivar datastore_id: ARM resource ID of the datastore where the asset is located. - :vartype datastore_id: str - :ivar path: The path of the file/directory in the datastore. - :vartype path: str - :ivar reference_type: [Required] Specifies the type of asset reference. Required. DATA_PATH. - :vartype reference_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DATA_PATH - """ - - datastore_id: Optional[str] = rest_field( - name="datastoreId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM resource ID of the datastore where the asset is located.""" - path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path of the file/directory in the datastore.""" - reference_type: Literal[ReferenceType.DATA_PATH] = rest_discriminator(name="referenceType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of asset reference. Required. DATA_PATH.""" - - @overload - def __init__( - self, - *, - datastore_id: Optional[str] = None, - path: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.reference_type = ReferenceType.DATA_PATH # type: ignore - - -class DataQualityMonitoringSignal(MonitoringSignalBase, discriminator="DataQuality"): - """DataQualityMonitoringSignal. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: The settings for computing feature importance. - :vartype feature_importance_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureImportanceSettings - :ivar features: The features to calculate drift over. - :vartype features: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureFilterBase - :ivar metric_thresholds: [Required] A list of metrics to calculate and their associated - thresholds. Required. - :vartype metric_thresholds: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataQualityMetricThresholdBase] - :ivar production_data: [Required] The data produced by the production service which drift will - be calculated for. Required. - :vartype production_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase - :ivar reference_data: [Required] The data to calculate drift against. Required. - :vartype reference_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase - :ivar signal_type: [Required] Specifies the type of signal to monitor. Required. Tracks model - input data integrity. - :vartype signal_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DATA_QUALITY - """ - - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = rest_field( - name="featureDataTypeOverride", visibility=["read", "create"] - ) - """A dictionary that maps feature names to their respective data types.""" - feature_importance_settings: Optional["_models.FeatureImportanceSettings"] = rest_field( - name="featureImportanceSettings", visibility=["read", "create"] - ) - """The settings for computing feature importance.""" - features: Optional["_models.MonitoringFeatureFilterBase"] = rest_field(visibility=["read", "create"]) - """The features to calculate drift over.""" - metric_thresholds: list["_models.DataQualityMetricThresholdBase"] = rest_field( - name="metricThresholds", visibility=["read", "create"] - ) - """[Required] A list of metrics to calculate and their associated thresholds. Required.""" - production_data: "_models.MonitoringInputDataBase" = rest_field( - name="productionData", visibility=["read", "create"] - ) - """[Required] The data produced by the production service which drift will be calculated for. - Required.""" - reference_data: "_models.MonitoringInputDataBase" = rest_field(name="referenceData", visibility=["read", "create"]) - """[Required] The data to calculate drift against. Required.""" - signal_type: Literal[MonitoringSignalType.DATA_QUALITY] = rest_discriminator(name="signalType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. Tracks model input data - integrity.""" - - @overload - def __init__( - self, - *, - metric_thresholds: list["_models.DataQualityMetricThresholdBase"], - production_data: "_models.MonitoringInputDataBase", - reference_data: "_models.MonitoringInputDataBase", - notification_types: Optional[list[Union[str, "_models.MonitoringNotificationType"]]] = None, - properties: Optional[dict[str, str]] = None, - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = None, - feature_importance_settings: Optional["_models.FeatureImportanceSettings"] = None, - features: Optional["_models.MonitoringFeatureFilterBase"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.signal_type = MonitoringSignalType.DATA_QUALITY # type: ignore - - -class DatasetReference(_Model): - """Dataset reference object. - - :ivar name: The name of the dataset reference. - :vartype name: str - :ivar id: The fully qualified ARM id of the dataset reference. - :vartype id: str - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the dataset reference.""" - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The fully qualified ARM id of the dataset reference.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Datastore(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreProperties - """ - - properties: "_models.DatastoreProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.DatastoreProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataVersionBase(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBaseProperties - """ - - properties: "_models.DataVersionBaseProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.DataVersionBaseProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DataVersionBaseProperties(AssetBase): - """Data version base definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - MLTableData, UriFileDataVersion, UriFolderDataVersion - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_type: [Required] Specifies the type of data. Required. Known values are: "uri_file", - "uri_folder", and "mltable". - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataType - :ivar data_uri: [Required] Uri of the data. Example: - `https://go.microsoft.com/fwlink/?linkid=2202330 - `_. Required. - :vartype data_uri: str - """ - - __mapping__: dict[str, _Model] = {} - data_type: str = rest_discriminator(name="dataType", visibility=["read", "create"]) - """[Required] Specifies the type of data. Required. Known values are: \"uri_file\", - \"uri_folder\", and \"mltable\".""" - data_uri: str = rest_field(name="dataUri", visibility=["read", "create"]) - """[Required] Uri of the data. Example: `https://go.microsoft.com/fwlink/?linkid=2202330 - `_. Required.""" - - @overload - def __init__( - self, - *, - data_type: str, - data_uri: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OnlineScaleSettings(_Model): - """Online deployment scaling configuration. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DefaultScaleSettings, TargetUtilizationScaleSettings - - :ivar scale_type: [Required] Type of deployment scaling algorithm. Required. Known values are: - "Default" and "TargetUtilization". - :vartype scale_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScaleType - """ - - __mapping__: dict[str, _Model] = {} - scale_type: str = rest_discriminator(name="scaleType", visibility=["read", "create", "update", "delete", "query"]) - """[Required] Type of deployment scaling algorithm. Required. Known values are: \"Default\" and - \"TargetUtilization\".""" - - @overload - def __init__( - self, - *, - scale_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DefaultScaleSettings(OnlineScaleSettings, discriminator="Default"): - """DefaultScaleSettings. - - :ivar scale_type: [Required] Type of deployment scaling algorithm. Required. DEFAULT. - :vartype scale_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DEFAULT - """ - - scale_type: Literal[ScaleType.DEFAULT] = rest_discriminator(name="scaleType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Type of deployment scaling algorithm. Required. DEFAULT.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.scale_type = ScaleType.DEFAULT # type: ignore - - -class DeltaModelCurrentState(_Model): - """Contract for DeltaModelCurrentState. - - :ivar count: Gets or sets Count of instances with model. - :vartype count: int - :ivar sample_instance_id: Gets or sets sample of instances with model. - :vartype sample_instance_id: str - :ivar status: Gets or sets status. - :vartype status: str - """ - - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets Count of instances with model.""" - sample_instance_id: Optional[str] = rest_field( - name="sampleInstanceID", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets sample of instances with model.""" - status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets status.""" - - @overload - def __init__( - self, - *, - count: Optional[int] = None, - sample_instance_id: Optional[str] = None, - status: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeltaModelListRequest(_Model): - """DeltaModelListRequest. - - :ivar count: Gets or sets number of delta models to return. Default: -1, means that all will be - returned. - :vartype count: int - :ivar skip_token: Gets or sets skip token for paginated response. - :vartype skip_token: str - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets number of delta models to return. Default: -1, means that all will be returned.""" - skip_token: Optional[str] = rest_field(name="skipToken", visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets skip token for paginated response.""" - target_base_model: Optional[str] = rest_field( - name="targetBaseModel", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets target base model.""" - - @overload - def __init__( - self, - *, - count: Optional[int] = None, - skip_token: Optional[str] = None, - target_base_model: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeltaModelModifyRequest(_Model): - """Contract base for DeltaModelChangeRequest. Used for adding or removing. - - :ivar add_delta_models: Gets or sets delta models to remove. - :vartype add_delta_models: list[str] - :ivar remove_delta_models: Gets or sets delta models to remove. - :vartype remove_delta_models: list[str] - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - add_delta_models: Optional[list[str]] = rest_field( - name="addDeltaModels", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets delta models to remove.""" - remove_delta_models: Optional[list[str]] = rest_field( - name="removeDeltaModels", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets delta models to remove.""" - target_base_model: Optional[str] = rest_field( - name="targetBaseModel", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets target base model.""" - - @overload - def __init__( - self, - *, - add_delta_models: Optional[list[str]] = None, - remove_delta_models: Optional[list[str]] = None, - target_base_model: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeltaModelStatusRequest(_Model): - """DeltaModelStatusRequest. - - :ivar delta_models: Gets or sets collection of delta models to retrieve status for. - :vartype delta_models: list[str] - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - delta_models: Optional[list[str]] = rest_field( - name="deltaModels", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets collection of delta models to retrieve status for.""" - target_base_model: Optional[str] = rest_field( - name="targetBaseModel", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets target base model.""" - - @overload - def __init__( - self, - *, - delta_models: Optional[list[str]] = None, - target_base_model: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeltaModelStatusResponse(_Model): - """Contract returning to user the delta models. - - :ivar actual_instance_count: Gets or sets actual instance count. - :vartype actual_instance_count: int - :ivar delta_models: Gets or sets dictionary representing modelID and its current state. - :vartype delta_models: dict[str, - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelCurrentState]] - :ivar expected_instance_count: Gets or sets expected instance count. - :vartype expected_instance_count: int - :ivar revision_id: Gets or sets revision ID. - :vartype revision_id: str - :ivar target_base_model: Gets or sets target base model. - :vartype target_base_model: str - """ - - actual_instance_count: Optional[int] = rest_field( - name="actualInstanceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets actual instance count.""" - delta_models: Optional[dict[str, list["_models.DeltaModelCurrentState"]]] = rest_field( - name="deltaModels", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets dictionary representing modelID and its current state.""" - expected_instance_count: Optional[int] = rest_field( - name="expectedInstanceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets expected instance count.""" - revision_id: Optional[str] = rest_field( - name="revisionId", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets revision ID.""" - target_base_model: Optional[str] = rest_field( - name="targetBaseModel", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets target base model.""" - - @overload - def __init__( - self, - *, - actual_instance_count: Optional[int] = None, - delta_models: Optional[dict[str, list["_models.DeltaModelCurrentState"]]] = None, - expected_instance_count: Optional[int] = None, - revision_id: Optional[str] = None, - target_base_model: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeploymentLogs(_Model): - """DeploymentLogs. - - :ivar content: The retrieved online deployment logs. - :vartype content: str - """ - - content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The retrieved online deployment logs.""" - - @overload - def __init__( - self, - *, - content: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeploymentLogsRequest(_Model): - """DeploymentLogsRequest. - - :ivar container_type: The type of container to retrieve logs from. Known values are: - "StorageInitializer" and "InferenceServer". - :vartype container_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContainerType - :ivar tail: The maximum number of lines to tail. - :vartype tail: int - """ - - container_type: Optional[Union[str, "_models.ContainerType"]] = rest_field( - name="containerType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of container to retrieve logs from. Known values are: \"StorageInitializer\" and - \"InferenceServer\".""" - tail: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of lines to tail.""" - - @overload - def __init__( - self, - *, - container_type: Optional[Union[str, "_models.ContainerType"]] = None, - tail: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ResourceConfiguration(_Model): - """ResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - instance_count: Optional[int] = rest_field(name="instanceCount", visibility=["read", "create"]) - """Optional number of instances or nodes used by the compute target.""" - instance_type: Optional[str] = rest_field(name="instanceType", visibility=["read", "create"]) - """Optional type of VM used as supported by the compute target.""" - properties: Optional[dict[str, Any]] = rest_field(visibility=["read", "create"]) - """Additional properties bag.""" - - @overload - def __init__( - self, - *, - instance_count: Optional[int] = None, - instance_type: Optional[str] = None, - properties: Optional[dict[str, Any]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeploymentResourceConfiguration(ResourceConfiguration): - """DeploymentResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - @overload - def __init__( - self, - *, - instance_count: Optional[int] = None, - instance_type: Optional[str] = None, - properties: Optional[dict[str, Any]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DestinationAsset(_Model): - """Publishing destination registry asset information. - - :ivar destination_name: Destination asset name. - :vartype destination_name: str - :ivar destination_version: Destination asset version. - :vartype destination_version: str - :ivar registry_name: Destination registry name. - :vartype registry_name: str - """ - - destination_name: Optional[str] = rest_field( - name="destinationName", visibility=["read", "create", "update", "delete", "query"] - ) - """Destination asset name.""" - destination_version: Optional[str] = rest_field( - name="destinationVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Destination asset version.""" - registry_name: Optional[str] = rest_field( - name="registryName", visibility=["read", "create", "update", "delete", "query"] - ) - """Destination registry name.""" - - @overload - def __init__( - self, - *, - destination_name: Optional[str] = None, - destination_version: Optional[str] = None, - registry_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DiagnoseRequestProperties(_Model): - """DiagnoseRequestProperties. - - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - :ivar required_resource_providers: Setting for diagnosing the presence of required resource - providers in the workspace. - :vartype required_resource_providers: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - """ - - application_insights: Optional[dict[str, Any]] = rest_field( - name="applicationInsights", visibility=["read", "create", "update", "delete", "query"] - ) - """Setting for diagnosing dependent application insights.""" - container_registry: Optional[dict[str, Any]] = rest_field( - name="containerRegistry", visibility=["read", "create", "update", "delete", "query"] - ) - """Setting for diagnosing dependent container registry.""" - dns_resolution: Optional[dict[str, Any]] = rest_field( - name="dnsResolution", visibility=["read", "create", "update", "delete", "query"] - ) - """Setting for diagnosing dns resolution.""" - key_vault: Optional[dict[str, Any]] = rest_field( - name="keyVault", visibility=["read", "create", "update", "delete", "query"] - ) - """Setting for diagnosing dependent key vault.""" - nsg: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Setting for diagnosing network security group.""" - others: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Setting for diagnosing unclassified category of problems.""" - required_resource_providers: Optional[dict[str, Any]] = rest_field( - name="requiredResourceProviders", visibility=["read", "create", "update", "delete", "query"] - ) - """Setting for diagnosing the presence of required resource providers in the workspace.""" - resource_lock: Optional[dict[str, Any]] = rest_field( - name="resourceLock", visibility=["read", "create", "update", "delete", "query"] - ) - """Setting for diagnosing resource lock.""" - storage_account: Optional[dict[str, Any]] = rest_field( - name="storageAccount", visibility=["read", "create", "update", "delete", "query"] - ) - """Setting for diagnosing dependent storage account.""" - udr: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Setting for diagnosing user defined routing.""" - - @overload - def __init__( - self, - *, - application_insights: Optional[dict[str, Any]] = None, - container_registry: Optional[dict[str, Any]] = None, - dns_resolution: Optional[dict[str, Any]] = None, - key_vault: Optional[dict[str, Any]] = None, - nsg: Optional[dict[str, Any]] = None, - others: Optional[dict[str, Any]] = None, - required_resource_providers: Optional[dict[str, Any]] = None, - resource_lock: Optional[dict[str, Any]] = None, - storage_account: Optional[dict[str, Any]] = None, - udr: Optional[dict[str, Any]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DiagnoseResponseResult(_Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResultValue - """ - - value: Optional["_models.DiagnoseResponseResultValue"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - value: Optional["_models.DiagnoseResponseResultValue"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DiagnoseResponseResultValue(_Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResult] - """ - - user_defined_route_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="userDefinedRouteResults", visibility=["read", "create", "update", "delete", "query"] - ) - network_security_rule_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="networkSecurityRuleResults", visibility=["read", "create", "update", "delete", "query"] - ) - resource_lock_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="resourceLockResults", visibility=["read", "create", "update", "delete", "query"] - ) - dns_resolution_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="dnsResolutionResults", visibility=["read", "create", "update", "delete", "query"] - ) - storage_account_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="storageAccountResults", visibility=["read", "create", "update", "delete", "query"] - ) - key_vault_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="keyVaultResults", visibility=["read", "create", "update", "delete", "query"] - ) - container_registry_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="containerRegistryResults", visibility=["read", "create", "update", "delete", "query"] - ) - application_insights_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="applicationInsightsResults", visibility=["read", "create", "update", "delete", "query"] - ) - other_results: Optional[list["_models.DiagnoseResult"]] = rest_field( - name="otherResults", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - user_defined_route_results: Optional[list["_models.DiagnoseResult"]] = None, - network_security_rule_results: Optional[list["_models.DiagnoseResult"]] = None, - resource_lock_results: Optional[list["_models.DiagnoseResult"]] = None, - dns_resolution_results: Optional[list["_models.DiagnoseResult"]] = None, - storage_account_results: Optional[list["_models.DiagnoseResult"]] = None, - key_vault_results: Optional[list["_models.DiagnoseResult"]] = None, - container_registry_results: Optional[list["_models.DiagnoseResult"]] = None, - application_insights_results: Optional[list["_models.DiagnoseResult"]] = None, - other_results: Optional[list["_models.DiagnoseResult"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DiagnoseResult(_Model): - """Result of Diagnose. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Known values are: "Warning", "Error", and - "Information". - :vartype level: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - code: Optional[str] = rest_field(visibility=["read"]) - """Code for workspace setup error.""" - level: Optional[Union[str, "_models.DiagnoseResultLevel"]] = rest_field(visibility=["read"]) - """Level of workspace setup error. Known values are: \"Warning\", \"Error\", and \"Information\".""" - message: Optional[str] = rest_field(visibility=["read"]) - """Message of workspace setup error.""" - - -class DiagnoseWorkspaceParameters(_Model): - """Parameters to diagnose a workspace. - - :ivar value: - :vartype value: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseRequestProperties - """ - - value: Optional["_models.DiagnoseRequestProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - value: Optional["_models.DiagnoseRequestProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DistillationJob(JobBaseProperties, discriminator="Distillation"): - """Distillation Job definition. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - :ivar data_generation_details: [Required]. Required. - :vartype data_generation_details: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataGenerationVertical - :ivar finetuning_details: [Required]. Required. - :vartype finetuning_details: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FinetuningDetails - :ivar outputs: [Required]. Required. - :vartype outputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QueueSettings - :ivar resources: Instance types and other resources for the job. - :vartype resources: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobResources - :ivar job_type: [Required] Specifies the type of job. Required. DISTILLATION. - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DISTILLATION - """ - - data_generation_details: "_models.DataGenerationVertical" = rest_field( - name="dataGenerationDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required]. Required.""" - finetuning_details: "_models.FinetuningDetails" = rest_field( - name="finetuningDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required]. Required.""" - outputs: dict[str, "_models.JobOutput"] = rest_field(visibility=["read", "create"]) - """[Required]. Required.""" - queue_settings: Optional["_models.QueueSettings"] = rest_field(name="queueSettings", visibility=["read", "create"]) - """Queue settings for the job.""" - resources: Optional["_models.JobResources"] = rest_field(visibility=["read", "create"]) - """Instance types and other resources for the job.""" - job_type: Literal[JobType.DISTILLATION] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. DISTILLATION.""" - - @overload - def __init__( - self, - *, - data_generation_details: "_models.DataGenerationVertical", - finetuning_details: "_models.FinetuningDetails", - outputs: dict[str, "_models.JobOutput"], - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - queue_settings: Optional["_models.QueueSettings"] = None, - resources: Optional["_models.JobResources"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = JobType.DISTILLATION # type: ignore - - -class DistributionConfiguration(_Model): - """Base definition for job distribution configuration. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - Mpi, PyTorch, TensorFlow - - :ivar distribution_type: [Required] Specifies the type of distribution framework. Required. - Known values are: "PyTorch", "TensorFlow", and "Mpi". - :vartype distribution_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DistributionType - """ - - __mapping__: dict[str, _Model] = {} - distribution_type: str = rest_discriminator(name="distributionType", visibility=["read", "create"]) - """[Required] Specifies the type of distribution framework. Required. Known values are: - \"PyTorch\", \"TensorFlow\", and \"Mpi\".""" - - @overload - def __init__( - self, - *, - distribution_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Docker(_Model): - """Docker. - - :ivar privileged: Indicate whether container shall run in privileged or non-privileged mode. - :vartype privileged: bool - """ - - privileged: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicate whether container shall run in privileged or non-privileged mode.""" - - @overload - def __init__( - self, - *, - privileged: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DockerCredential(DataReferenceCredential, discriminator="DockerCredentials"): - """Credential for docker with username and password. - - :ivar password: DockerCredential user password. - :vartype password: str - :ivar user_name: DockerCredential user name. - :vartype user_name: str - :ivar credential_type: [Required] Credential type used to authentication with storage. - Required. DOCKER_CREDENTIALS. - :vartype credential_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DOCKER_CREDENTIALS - """ - - password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """DockerCredential user password.""" - user_name: Optional[str] = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"]) - """DockerCredential user name.""" - credential_type: Literal[DataReferenceCredentialType.DOCKER_CREDENTIALS] = rest_discriminator(name="credentialType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. DOCKER_CREDENTIALS.""" - - @overload - def __init__( - self, - *, - password: Optional[str] = None, - user_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credential_type = DataReferenceCredentialType.DOCKER_CREDENTIALS # type: ignore - - -class EncryptionKeyVaultUpdateProperties(_Model): - """EncryptionKeyVaultUpdateProperties. - - :ivar key_identifier: Required. - :vartype key_identifier: str - """ - - key_identifier: str = rest_field(name="keyIdentifier", visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - key_identifier: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EncryptionProperty(_Model): - """EncryptionProperty. - - :ivar cosmos_db_resource_id: The byok cosmosdb account that customer brings to store customer's - data with encryption. - :vartype cosmos_db_resource_id: str - :ivar identity: Identity to be used with the keyVault. - :vartype identity: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityForCmk - :ivar key_vault_properties: KeyVault details to do the encryption. Required. - :vartype key_vault_properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.KeyVaultProperties - :ivar search_account_resource_id: The byok search account that customer brings to store - customer's data with encryption. - :vartype search_account_resource_id: str - :ivar status: Indicates whether or not the encryption is enabled for the workspace. Required. - Known values are: "Enabled" and "Disabled". - :vartype status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EncryptionStatus - :ivar storage_account_resource_id: The byok storage account that customer brings to store - customer's data with encryption. - :vartype storage_account_resource_id: str - """ - - cosmos_db_resource_id: Optional[str] = rest_field( - name="cosmosDbResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The byok cosmosdb account that customer brings to store customer's data with encryption.""" - identity: Optional["_models.IdentityForCmk"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Identity to be used with the keyVault.""" - key_vault_properties: "_models.KeyVaultProperties" = rest_field( - name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """KeyVault details to do the encryption. Required.""" - search_account_resource_id: Optional[str] = rest_field( - name="searchAccountResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The byok search account that customer brings to store customer's data with encryption.""" - status: Union[str, "_models.EncryptionStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether or not the encryption is enabled for the workspace. Required. Known values - are: \"Enabled\" and \"Disabled\".""" - storage_account_resource_id: Optional[str] = rest_field( - name="storageAccountResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The byok storage account that customer brings to store customer's data with encryption.""" - - @overload - def __init__( - self, - *, - key_vault_properties: "_models.KeyVaultProperties", - status: Union[str, "_models.EncryptionStatus"], - cosmos_db_resource_id: Optional[str] = None, - identity: Optional["_models.IdentityForCmk"] = None, - search_account_resource_id: Optional[str] = None, - storage_account_resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EncryptionUpdateProperties(_Model): - """EncryptionUpdateProperties. - - :ivar key_vault_properties: Required. - :vartype key_vault_properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EncryptionKeyVaultUpdateProperties - """ - - key_vault_properties: "_models.EncryptionKeyVaultUpdateProperties" = rest_field( - name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - - @overload - def __init__( - self, - *, - key_vault_properties: "_models.EncryptionKeyVaultUpdateProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Endpoint(_Model): - """Endpoint. - - :ivar protocol: Endpoint Communication Protocol. Known values are: "tcp", "udp", and "http". - :vartype protocol: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Protocol - :ivar name: Name of the Endpoint. - :vartype name: str - :ivar target: Application port inside the container. - :vartype target: int - :ivar published: Port over which the application is exposed from container. - :vartype published: int - :ivar host_ip: Host IP over which the application is exposed from the container. - :vartype host_ip: str - """ - - protocol: Optional[Union[str, "_models.Protocol"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Endpoint Communication Protocol. Known values are: \"tcp\", \"udp\", and \"http\".""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Endpoint.""" - target: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Application port inside the container.""" - published: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Port over which the application is exposed from container.""" - host_ip: Optional[str] = rest_field(name="hostIp", visibility=["read", "create", "update", "delete", "query"]) - """Host IP over which the application is exposed from the container.""" - - @overload - def __init__( - self, - *, - protocol: Optional[Union[str, "_models.Protocol"]] = None, - name: Optional[str] = None, - target: Optional[int] = None, - published: Optional[int] = None, - host_ip: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointAuthKeys(_Model): - """Keys for endpoint authentication. - - :ivar primary_key: The primary key. - :vartype primary_key: str - :ivar secondary_key: The secondary key. - :vartype secondary_key: str - """ - - primary_key: Optional[str] = rest_field(name="primaryKey", visibility=["read", "create"]) - """The primary key.""" - secondary_key: Optional[str] = rest_field(name="secondaryKey", visibility=["read", "create"]) - """The secondary key.""" - - @overload - def __init__( - self, - *, - primary_key: Optional[str] = None, - secondary_key: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointAuthToken(_Model): - """Service Token. - - :ivar access_token: Access token for endpoint authentication. - :vartype access_token: str - :ivar expiry_time_utc: Access token expiry time (UTC). - :vartype expiry_time_utc: int - :ivar refresh_after_time_utc: Refresh access token after time (UTC). - :vartype refresh_after_time_utc: int - :ivar token_type: Access token type. - :vartype token_type: str - """ - - access_token: Optional[str] = rest_field( - name="accessToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Access token for endpoint authentication.""" - expiry_time_utc: Optional[int] = rest_field( - name="expiryTimeUtc", visibility=["read", "create", "update", "delete", "query"] - ) - """Access token expiry time (UTC).""" - refresh_after_time_utc: Optional[int] = rest_field( - name="refreshAfterTimeUtc", visibility=["read", "create", "update", "delete", "query"] - ) - """Refresh access token after time (UTC).""" - token_type: Optional[str] = rest_field(name="tokenType", visibility=["read", "create", "update", "delete", "query"]) - """Access token type.""" - - @overload - def __init__( - self, - *, - access_token: Optional[str] = None, - expiry_time_utc: Optional[int] = None, - refresh_after_time_utc: Optional[int] = None, - token_type: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointDeploymentModel(_Model): - """EndpointDeploymentModel. - - :ivar format: Model format. - :vartype format: str - :ivar name: Model name. - :vartype name: str - :ivar source: Optional. Deployment model source ARM resource ID. - :vartype source: str - :ivar version: Model version. - :vartype version: str - """ - - format: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model format.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model name.""" - source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional. Deployment model source ARM resource ID.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model version.""" - - @overload - def __init__( - self, - *, - format: Optional[str] = None, - name: Optional[str] = None, - source: Optional[str] = None, - version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointDeploymentResourcePropertiesBasicResource(ProxyResource): # pylint: disable=name-too-long - """EndpointDeploymentResourcePropertiesBasicResource is preview-only. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourceProperties - """ - - properties: "_models.EndpointDeploymentResourceProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.EndpointDeploymentResourceProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointKeys(_Model): - """EndpointKeys. - - :ivar keys_property: Dictionary of Keys for the endpoint. - :vartype keys_property: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - """ - - keys_property: Optional["_models.AccountApiKeys"] = rest_field( - name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" - ) - """Dictionary of Keys for the endpoint.""" - - @overload - def __init__( - self, - *, - keys_property: Optional["_models.AccountApiKeys"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModelDeprecationProperties(_Model): - """EndpointModelDeprecationProperties. - - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: ~datetime.datetime - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: ~datetime.datetime - """ - - fine_tune: Optional[datetime.datetime] = rest_field( - name="fineTune", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The datetime of deprecation of the fineTune Model.""" - inference: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The datetime of deprecation of the inference Model.""" - - @overload - def __init__( - self, - *, - fine_tune: Optional[datetime.datetime] = None, - inference: Optional[datetime.datetime] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModelProperties(_Model): - """Endpoint Model properties. - - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar deprecation: - :vartype deprecation: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelDeprecationProperties - :ivar finetune_capabilities: The capabilities for finetune models. - :vartype finetune_capabilities: dict[str, str] - :ivar format: Deployment model format. - :vartype format: str - :ivar is_default_version: If the model is default version. - :vartype is_default_version: bool - :ivar lifecycle_status: Model lifecycle status. Known values are: "GenerallyAvailable" and - "Preview". - :vartype lifecycle_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelLifecycleStatus - :ivar max_capacity: The max capacity. - :vartype max_capacity: int - :ivar name: Deployment model name. - :vartype name: str - :ivar skus: The list of Model Sku. - :vartype skus: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelSkuProperties] - :ivar system_data: - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar version: Optional. Deployment model version. If version is not specified, a default - version will be assigned. The default version is different for different models and might - change when there is new version available for a model. Default version for a model could be - found from list models API. - :vartype version: str - """ - - capabilities: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The capabilities.""" - deprecation: Optional["_models.EndpointModelDeprecationProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - finetune_capabilities: Optional[dict[str, str]] = rest_field( - name="finetuneCapabilities", visibility=["read", "create", "update", "delete", "query"] - ) - """The capabilities for finetune models.""" - format: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deployment model format.""" - is_default_version: Optional[bool] = rest_field( - name="isDefaultVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """If the model is default version.""" - lifecycle_status: Optional[Union[str, "_models.ModelLifecycleStatus"]] = rest_field( - name="lifecycleStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Model lifecycle status. Known values are: \"GenerallyAvailable\" and \"Preview\".""" - max_capacity: Optional[int] = rest_field( - name="maxCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - """The max capacity.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deployment model name.""" - skus: Optional[list["_models.EndpointModelSkuProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of Model Sku.""" - system_data: Optional["_models.SystemData"] = rest_field( - name="systemData", visibility=["read", "create", "update", "delete", "query"] - ) - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional. Deployment model version. If version is not specified, a default version will be - assigned. The default version is different for different models and might change when there is - new version available for a model. Default version for a model could be found from list models - API.""" - - @overload - def __init__( - self, - *, - capabilities: Optional[dict[str, str]] = None, - deprecation: Optional["_models.EndpointModelDeprecationProperties"] = None, - finetune_capabilities: Optional[dict[str, str]] = None, - format: Optional[str] = None, - is_default_version: Optional[bool] = None, - lifecycle_status: Optional[Union[str, "_models.ModelLifecycleStatus"]] = None, - max_capacity: Optional[int] = None, - name: Optional[str] = None, - skus: Optional[list["_models.EndpointModelSkuProperties"]] = None, - system_data: Optional["_models.SystemData"] = None, - version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModels(_Model): - """Paged collection of EndpointModelProperties items. - - :ivar value: The EndpointModelProperties items on this page. Required. - :vartype value: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelProperties] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - value: list["_models.EndpointModelProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The EndpointModelProperties items on this page. Required.""" - next_link: Optional[str] = rest_field(name="nextLink", visibility=["read", "create", "update", "delete", "query"]) - """The link to the next page of items.""" - - @overload - def __init__( - self, - *, - value: list["_models.EndpointModelProperties"], - next_link: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModelSkuCapacityProperties(_Model): - """EndpointModelSkuCapacityProperties. - - :ivar default: The default capacity. - :vartype default: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - """ - - default: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default capacity.""" - maximum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum capacity.""" - - @overload - def __init__( - self, - *, - default: Optional[int] = None, - maximum: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModelSkuProperties(_Model): - """EndpointModelSkuProperties. - - :ivar capacity: - :vartype capacity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelSkuCapacityProperties - :ivar connection_ids: The list of ARM id for the connection support this SKU. - :vartype connection_ids: list[str] - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar name: The name of the model SKU. - :vartype name: str - :ivar rate_limits: - :vartype rate_limits: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelSkuRateLimitProperties] - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - """ - - capacity: Optional["_models.EndpointModelSkuCapacityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - connection_ids: Optional[list[str]] = rest_field( - name="connectionIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of ARM id for the connection support this SKU.""" - deprecation_date: Optional[datetime.datetime] = rest_field( - name="deprecationDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The datetime of deprecation of the model SKU.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the model SKU.""" - rate_limits: Optional[list["_models.EndpointModelSkuRateLimitProperties"]] = rest_field( - name="rateLimits", visibility=["read", "create", "update", "delete", "query"] - ) - usage_name: Optional[str] = rest_field(name="usageName", visibility=["read", "create", "update", "delete", "query"]) - """The usage name of the model SKU.""" - - @overload - def __init__( - self, - *, - capacity: Optional["_models.EndpointModelSkuCapacityProperties"] = None, - connection_ids: Optional[list[str]] = None, - deprecation_date: Optional[datetime.datetime] = None, - name: Optional[str] = None, - rate_limits: Optional[list["_models.EndpointModelSkuRateLimitProperties"]] = None, - usage_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModelSkuRateLimitProperties(_Model): - """EndpointModelSkuRateLimitProperties. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: The call rate limit for the model. - :vartype rules: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelSkuRateLimitRuleProperties] - """ - - count: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The count value of Call Rate Limit.""" - renewal_period: Optional[float] = rest_field( - name="renewalPeriod", visibility=["read", "create", "update", "delete", "query"] - ) - """The renewal period in seconds of Call Rate Limit.""" - rules: Optional[list["_models.EndpointModelSkuRateLimitRuleProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The call rate limit for the model.""" - - @overload - def __init__( - self, - *, - count: Optional[float] = None, - renewal_period: Optional[float] = None, - rules: Optional[list["_models.EndpointModelSkuRateLimitRuleProperties"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModelSkuRateLimitRulePatternProperties(_Model): # pylint: disable=name-too-long - """EndpointModelSkuRateLimitRulePatternProperties. - - :ivar method: - :vartype method: str - :ivar path: - :vartype path: str - """ - - method: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - method: Optional[str] = None, - path: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointModelSkuRateLimitRuleProperties(_Model): - """EndpointModelSkuRateLimitRuleProperties. - - :ivar count: - :vartype count: float - :ivar dynamic_throttling_enabled: If the dynamic throttling is enabled. - :vartype dynamic_throttling_enabled: bool - :ivar key: - :vartype key: str - :ivar match_patterns: - :vartype match_patterns: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelSkuRateLimitRulePatternProperties] - :ivar min_count: - :vartype min_count: float - :ivar renewal_period: - :vartype renewal_period: float - """ - - count: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - dynamic_throttling_enabled: Optional[bool] = rest_field( - name="dynamicThrottlingEnabled", visibility=["read", "create", "update", "delete", "query"] - ) - """If the dynamic throttling is enabled.""" - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - match_patterns: Optional[list["_models.EndpointModelSkuRateLimitRulePatternProperties"]] = rest_field( - name="matchPatterns", visibility=["read", "create", "update", "delete", "query"] - ) - min_count: Optional[float] = rest_field(name="minCount", visibility=["read", "create", "update", "delete", "query"]) - renewal_period: Optional[float] = rest_field( - name="renewalPeriod", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - count: Optional[float] = None, - dynamic_throttling_enabled: Optional[bool] = None, - key: Optional[str] = None, - match_patterns: Optional[list["_models.EndpointModelSkuRateLimitRulePatternProperties"]] = None, - min_count: Optional[float] = None, - renewal_period: Optional[float] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointResourcePropertiesBasicResource(ProxyResource): - """EndpointResourcePropertiesBasicResource is a preview-only resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourceProperties - """ - - properties: "_models.EndpointResourceProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.EndpointResourceProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EndpointScheduleAction(ScheduleActionBase, discriminator="InvokeBatchEndpoint"): - """EndpointScheduleAction. - - :ivar endpoint_invocation_definition: [Required] Defines Schedule action definition details. - . Required. - :vartype endpoint_invocation_definition: dict[str, any] - :ivar action_type: [Required] Specifies the action type of the schedule. Required. - INVOKE_BATCH_ENDPOINT. - :vartype action_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.INVOKE_BATCH_ENDPOINT - """ - - endpoint_invocation_definition: dict[str, Any] = rest_field( - name="endpointInvocationDefinition", visibility=["read", "create", "update"] - ) - """[Required] Defines Schedule action definition details. . Required.""" - action_type: Literal[ScheduleActionType.INVOKE_BATCH_ENDPOINT] = rest_discriminator(name="actionType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the action type of the schedule. Required. INVOKE_BATCH_ENDPOINT.""" - - @overload - def __init__( - self, - *, - endpoint_invocation_definition: dict[str, Any], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.action_type = ScheduleActionType.INVOKE_BATCH_ENDPOINT # type: ignore - - -class EnvironmentContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainerProperties - """ - - properties: "_models.EnvironmentContainerProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.EnvironmentContainerProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EnvironmentContainerProperties(AssetContainer): - """Container for environment specification versions. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the environment container. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the environment container. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EnvironmentVariable(_Model): - """EnvironmentVariable. - - :ivar type: Type of Environment Variable. "local" - :vartype type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVariableType - :ivar value: Value of the Environment variable. - :vartype value: str - """ - - type: Optional[Union[str, "_models.EnvironmentVariableType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of Environment Variable. \"local\"""" - value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Value of the Environment variable.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.EnvironmentVariableType"]] = None, - value: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EnvironmentVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersionProperties - """ - - properties: "_models.EnvironmentVersionProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.EnvironmentVersionProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EnvironmentVersionProperties(AssetBase): - """Environment version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar auto_rebuild: AutoRebuild setting for the derived image. Known values are: "Disabled" and - "OnBaseImageUpdate". - :vartype auto_rebuild: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AutoRebuildSetting - :ivar build: Configuration settings for Docker build context. - :vartype build: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BuildContext - :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of - package, including Python, R, and C/C++ packages. . - :vartype conda_file: str - :ivar environment_type: Environment type is either user managed or curated by the Azure ML - service . Known values are: "Curated" and "UserCreated". - :vartype environment_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentType - :ivar image: Name of the image that will be used for the environment. . - :vartype image: str - :ivar image_details: Environment image details. - :vartype image_details: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageDetails - :ivar inference_config: Defines configuration specific to inference. - :vartype inference_config: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceContainerProperties - :ivar os_type: The type of operating system. Known values are: "Linux" and "Windows". - :vartype os_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OperatingSystemType - :ivar provisioning_state: Provisioning state for the environment version. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - :ivar stage: Stage in the environment lifecycle assigned to this environment. - :vartype stage: str - """ - - auto_rebuild: Optional[Union[str, "_models.AutoRebuildSetting"]] = rest_field( - name="autoRebuild", visibility=["read", "create"] - ) - """AutoRebuild setting for the derived image. Known values are: \"Disabled\" and - \"OnBaseImageUpdate\".""" - build: Optional["_models.BuildContext"] = rest_field(visibility=["read", "create"]) - """Configuration settings for Docker build context.""" - conda_file: Optional[str] = rest_field(name="condaFile", visibility=["read", "create"]) - """Standard configuration file used by Conda that lets you install any kind of package, including - Python, R, and C/C++ packages. .""" - environment_type: Optional[Union[str, "_models.EnvironmentType"]] = rest_field( - name="environmentType", visibility=["read"] - ) - """Environment type is either user managed or curated by the Azure ML service . Known values are: \"Curated\" and \"UserCreated\".""" - image: Optional[str] = rest_field(visibility=["read", "create"]) - """Name of the image that will be used for the environment. .""" - image_details: Optional["_models.ImageDetails"] = rest_field( - name="imageDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Environment image details.""" - inference_config: Optional["_models.InferenceContainerProperties"] = rest_field( - name="inferenceConfig", visibility=["read", "create"] - ) - """Defines configuration specific to inference.""" - os_type: Optional[Union[str, "_models.OperatingSystemType"]] = rest_field( - name="osType", visibility=["read", "create"] - ) - """The type of operating system. Known values are: \"Linux\" and \"Windows\".""" - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the environment version. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - stage: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Stage in the environment lifecycle assigned to this environment.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - auto_rebuild: Optional[Union[str, "_models.AutoRebuildSetting"]] = None, - build: Optional["_models.BuildContext"] = None, - conda_file: Optional[str] = None, - image: Optional[str] = None, - image_details: Optional["_models.ImageDetails"] = None, - inference_config: Optional["_models.InferenceContainerProperties"] = None, - os_type: Optional[Union[str, "_models.OperatingSystemType"]] = None, - stage: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ErrorAdditionalInfo(_Model): - """The resource management error additional info. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - type: Optional[str] = rest_field(visibility=["read"]) - """The additional info type.""" - info: Optional[Any] = rest_field(visibility=["read"]) - """The additional info.""" - - -class ErrorDetail(_Model): - """The error detail. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorAdditionalInfo] - """ - - code: Optional[str] = rest_field(visibility=["read"]) - """The error code.""" - message: Optional[str] = rest_field(visibility=["read"]) - """The error message.""" - target: Optional[str] = rest_field(visibility=["read"]) - """The error target.""" - details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) - """The error details.""" - additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( - name="additionalInfo", visibility=["read"] - ) - """The error additional info.""" - - -class ErrorResponse(_Model): - """Error response. - - :ivar error: The error object. - :vartype error: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorDetail - """ - - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error object.""" - - @overload - def __init__( - self, - *, - error: Optional["_models.ErrorDetail"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EstimatedVMPrice(_Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - :ivar retail_price: Retail price. Required. - :vartype retail_price: float - :ivar os_type: OS type. Required. Known values are: "Linux" and "Windows". - :vartype os_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VMPriceOSType - :ivar vm_tier: VM tier. Required. Known values are: "Standard", "LowPriority", and "Spot". - :vartype vm_tier: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VMTier - """ - - retail_price: float = rest_field(name="retailPrice", visibility=["read", "create", "update", "delete", "query"]) - """Retail price. Required.""" - os_type: Union[str, "_models.VMPriceOSType"] = rest_field( - name="osType", visibility=["read", "create", "update", "delete", "query"] - ) - """OS type. Required. Known values are: \"Linux\" and \"Windows\".""" - vm_tier: Union[str, "_models.VMTier"] = rest_field( - name="vmTier", visibility=["read", "create", "update", "delete", "query"] - ) - """VM tier. Required. Known values are: \"Standard\", \"LowPriority\", and \"Spot\".""" - - @overload - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "_models.VMPriceOSType"], - vm_tier: Union[str, "_models.VMTier"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EstimatedVMPrices(_Model): - """The estimated price info for using a VM. - - :ivar billing_currency: Billing currency. Required. "USD" - :vartype billing_currency: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BillingCurrency - :ivar unit_of_measure: Unit of time measure. Required. "OneHour" - :vartype unit_of_measure: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UnitOfMeasure - :ivar values_property: List of estimated VM prices. Required. - :vartype values_property: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EstimatedVMPrice] - """ - - billing_currency: Union[str, "_models.BillingCurrency"] = rest_field( - name="billingCurrency", visibility=["read", "create", "update", "delete", "query"] - ) - """Billing currency. Required. \"USD\"""" - unit_of_measure: Union[str, "_models.UnitOfMeasure"] = rest_field( - name="unitOfMeasure", visibility=["read", "create", "update", "delete", "query"] - ) - """Unit of time measure. Required. \"OneHour\"""" - values_property: list["_models.EstimatedVMPrice"] = rest_field( - name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" - ) - """List of estimated VM prices. Required.""" - - @overload - def __init__( - self, - *, - billing_currency: Union[str, "_models.BillingCurrency"], - unit_of_measure: Union[str, "_models.UnitOfMeasure"], - values_property: list["_models.EstimatedVMPrice"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ExternalFQDNResponse(_Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FQDNEndpointsPropertyBag] - """ - - value: Optional[list["_models.FQDNEndpointsPropertyBag"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - value: Optional[list["_models.FQDNEndpointsPropertyBag"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Feature(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureProperties - """ - - properties: "_models.FeatureProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.FeatureProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase, discriminator="FeatureAttributionDrift"): - """FeatureAttributionDriftMonitoringSignal. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureDataType] - :ivar feature_importance_settings: [Required] The settings for computing feature importance. - Required. - :vartype feature_importance_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureImportanceSettings - :ivar metric_threshold: [Required] A list of metrics to calculate and their associated - thresholds. Required. - :vartype metric_threshold: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureAttributionMetricThreshold - :ivar production_data: [Required] The data which drift will be calculated for. Required. - :vartype production_data: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase] - :ivar reference_data: [Required] The data to calculate drift against. Required. - :vartype reference_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase - :ivar signal_type: [Required] Specifies the type of signal to monitor. Required. Tracks feature - importance change in production, comparing against feature importance at training time. - :vartype signal_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FEATURE_ATTRIBUTION_DRIFT - """ - - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = rest_field( - name="featureDataTypeOverride", visibility=["read", "create"] - ) - """A dictionary that maps feature names to their respective data types.""" - feature_importance_settings: "_models.FeatureImportanceSettings" = rest_field( - name="featureImportanceSettings", visibility=["read", "create"] - ) - """[Required] The settings for computing feature importance. Required.""" - metric_threshold: "_models.FeatureAttributionMetricThreshold" = rest_field( - name="metricThreshold", visibility=["read", "create"] - ) - """[Required] A list of metrics to calculate and their associated thresholds. Required.""" - production_data: list["_models.MonitoringInputDataBase"] = rest_field( - name="productionData", visibility=["read", "create"] - ) - """[Required] The data which drift will be calculated for. Required.""" - reference_data: "_models.MonitoringInputDataBase" = rest_field(name="referenceData", visibility=["read", "create"]) - """[Required] The data to calculate drift against. Required.""" - signal_type: Literal[MonitoringSignalType.FEATURE_ATTRIBUTION_DRIFT] = rest_discriminator(name="signalType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. Tracks feature importance change - in production, comparing against feature importance at training time.""" - - @overload - def __init__( - self, - *, - feature_importance_settings: "_models.FeatureImportanceSettings", - metric_threshold: "_models.FeatureAttributionMetricThreshold", - production_data: list["_models.MonitoringInputDataBase"], - reference_data: "_models.MonitoringInputDataBase", - notification_types: Optional[list[Union[str, "_models.MonitoringNotificationType"]]] = None, - properties: Optional[dict[str, str]] = None, - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.signal_type = MonitoringSignalType.FEATURE_ATTRIBUTION_DRIFT # type: ignore - - -class FeatureAttributionMetricThreshold(_Model): - """FeatureAttributionMetricThreshold. - - :ivar metric: [Required] The feature attribution metric to calculate. Required. - "NormalizedDiscountedCumulativeGain" - :vartype metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureAttributionMetric - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - """ - - metric: Union[str, "_models.FeatureAttributionMetric"] = rest_field(visibility=["read", "create"]) - """[Required] The feature attribution metric to calculate. Required. - \"NormalizedDiscountedCumulativeGain\"""" - threshold: Optional["_models.MonitoringThreshold"] = rest_field(visibility=["read", "create"]) - """The threshold value. If null, a default value will be set depending on the selected metric.""" - - @overload - def __init__( - self, - *, - metric: Union[str, "_models.FeatureAttributionMetric"], - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeatureImportanceSettings(_Model): - """FeatureImportanceSettings. - - :ivar mode: The mode of operation for computing feature importance. Known values are: - "Disabled" and "Enabled". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureImportanceMode - :ivar target_column: The name of the target column within the input data asset. - :vartype target_column: str - """ - - mode: Optional[Union[str, "_models.FeatureImportanceMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The mode of operation for computing feature importance. Known values are: \"Disabled\" and - \"Enabled\".""" - target_column: Optional[str] = rest_field( - name="targetColumn", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the target column within the input data asset.""" - - @overload - def __init__( - self, - *, - mode: Optional[Union[str, "_models.FeatureImportanceMode"]] = None, - target_column: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeatureProperties(ResourceBase): - """DTO object representing feature. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar data_type: Specifies type. Known values are: "String", "Integer", "Long", "Float", - "Double", "Binary", "Datetime", and "Boolean". - :vartype data_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureDataType - :ivar feature_name: Specifies name. - :vartype feature_name: str - """ - - data_type: Optional[Union[str, "_models.FeatureDataType"]] = rest_field( - name="dataType", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies type. Known values are: \"String\", \"Integer\", \"Long\", \"Float\", \"Double\", - \"Binary\", \"Datetime\", and \"Boolean\".""" - feature_name: Optional[str] = rest_field( - name="featureName", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies name.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - data_type: Optional[Union[str, "_models.FeatureDataType"]] = None, - feature_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturesetContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainerProperties - """ - - properties: "_models.FeaturesetContainerProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.FeaturesetContainerProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturesetContainerProperties(AssetContainer): - """DTO object representing feature set. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featureset container. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the featureset container. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturesetSpecification(_Model): - """DTO object representing specification. - - :ivar path: Specifies the spec path. - :vartype path: str - """ - - path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the spec path.""" - - @overload - def __init__( - self, - *, - path: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturesetVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionProperties - """ - - properties: "_models.FeaturesetVersionProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.FeaturesetVersionProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturesetVersionBackfillRequest(_Model): - """Request payload for creating a backfill request for a given feature set version. - - :ivar data_availability_status: Specified the data availability status that you want to - backfill. - :vartype data_availability_status: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataAvailabilityStatus] - :ivar description: Specifies description. - :vartype description: str - :ivar display_name: Specifies description. - :vartype display_name: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureWindow - :ivar job_id: Specify the jobId to retry the failed materialization. - :vartype job_id: str - :ivar properties: Specifies the properties. - :vartype properties: dict[str, str] - :ivar resource: Specifies the compute resource settings. - :vartype resource: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MaterializationComputeResource - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar tags: Specifies the tags. - :vartype tags: dict[str, str] - """ - - data_availability_status: Optional[list[Union[str, "_models.DataAvailabilityStatus"]]] = rest_field( - name="dataAvailabilityStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Specified the data availability status that you want to backfill.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies description.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies description.""" - feature_window: Optional["_models.FeatureWindow"] = rest_field( - name="featureWindow", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the backfill feature window to be materialized.""" - job_id: Optional[str] = rest_field(name="jobId", visibility=["read", "create", "update", "delete", "query"]) - """Specify the jobId to retry the failed materialization.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the properties.""" - resource: Optional["_models.MaterializationComputeResource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the compute resource settings.""" - spark_configuration: Optional[dict[str, str]] = rest_field( - name="sparkConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the spark compute settings.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the tags.""" - - @overload - def __init__( - self, - *, - data_availability_status: Optional[list[Union[str, "_models.DataAvailabilityStatus"]]] = None, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["_models.FeatureWindow"] = None, - job_id: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - resource: Optional["_models.MaterializationComputeResource"] = None, - spark_configuration: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturesetVersionBackfillResponse(_Model): - """Response payload for creating a backfill request for a given feature set version. - - :ivar job_ids: List of jobs submitted as part of the backfill request. - :vartype job_ids: list[str] - """ - - job_ids: Optional[list[str]] = rest_field(name="jobIds", visibility=["read", "create", "update", "delete", "query"]) - """List of jobs submitted as part of the backfill request.""" - - @overload - def __init__( - self, - *, - job_ids: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturesetVersionProperties(AssetBase): - """DTO object representing feature set version. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar entities: Specifies list of entities. - :vartype entities: list[str] - :ivar materialization_settings: Specifies the materialization settings. - :vartype materialization_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MaterializationSettings - :ivar provisioning_state: Provisioning state for the featureset version container. Known values - are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - :ivar specification: Specifies the feature spec details. - :vartype specification: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetSpecification - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - entities: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies list of entities.""" - materialization_settings: Optional["_models.MaterializationSettings"] = rest_field( - name="materializationSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the materialization settings.""" - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the featureset version container. Known values are: \"Succeeded\", - \"Failed\", \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - specification: Optional["_models.FeaturesetSpecification"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the feature spec details.""" - stage: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the asset stage.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - entities: Optional[list[str]] = None, - materialization_settings: Optional["_models.MaterializationSettings"] = None, - specification: Optional["_models.FeaturesetSpecification"] = None, - stage: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturestoreEntityContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainerProperties - """ - - properties: "_models.FeaturestoreEntityContainerProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.FeaturestoreEntityContainerProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturestoreEntityContainerProperties(AssetContainer): - """DTO object representing feature entity. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the featurestore entity container. Known - values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the featurestore entity container. Known values are: \"Succeeded\", - \"Failed\", \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturestoreEntityVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersionProperties - """ - - properties: "_models.FeaturestoreEntityVersionProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.FeaturestoreEntityVersionProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturestoreEntityVersionProperties(AssetBase): - """DTO object representing feature entity version. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar index_columns: Specifies index columns. - :vartype index_columns: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IndexColumn] - :ivar provisioning_state: Provisioning state for the featurestore entity version. Known values - are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - :ivar stage: Specifies the asset stage. - :vartype stage: str - """ - - index_columns: Optional[list["_models.IndexColumn"]] = rest_field( - name="indexColumns", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies index columns.""" - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the featurestore entity version. Known values are: \"Succeeded\", - \"Failed\", \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - stage: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the asset stage.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - index_columns: Optional[list["_models.IndexColumn"]] = None, - stage: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeatureStoreSettings(_Model): - """FeatureStoreSettings. - - :ivar compute_runtime: - :vartype compute_runtime: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeRuntimeDto - :ivar offline_store_connection_name: - :vartype offline_store_connection_name: str - :ivar online_store_connection_name: - :vartype online_store_connection_name: str - """ - - compute_runtime: Optional["_models.ComputeRuntimeDto"] = rest_field( - name="computeRuntime", visibility=["read", "create", "update", "delete", "query"] - ) - offline_store_connection_name: Optional[str] = rest_field( - name="offlineStoreConnectionName", visibility=["read", "create", "update", "delete", "query"] - ) - online_store_connection_name: Optional[str] = rest_field( - name="onlineStoreConnectionName", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - compute_runtime: Optional["_models.ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeatureSubset(MonitoringFeatureFilterBase, discriminator="FeatureSubset"): - """FeatureSubset. - - :ivar features: [Required] The list of features to include. Required. - :vartype features: list[str] - :ivar filter_type: [Required] Specifies the feature filter to leverage when selecting features - to calculate metrics over. Required. Includes a user-defined subset of features. - :vartype filter_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FEATURE_SUBSET - """ - - features: list[str] = rest_field(visibility=["read", "create"]) - """[Required] The list of features to include. Required.""" - filter_type: Literal[MonitoringFeatureFilterType.FEATURE_SUBSET] = rest_discriminator(name="filterType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the feature filter to leverage when selecting features to calculate - metrics over. Required. Includes a user-defined subset of features.""" - - @overload - def __init__( - self, - *, - features: list[str], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.filter_type = MonitoringFeatureFilterType.FEATURE_SUBSET # type: ignore - - -class FeatureWindow(_Model): - """Specifies the feature window. - - :ivar feature_window_end: Specifies the feature window end time. - :vartype feature_window_end: ~datetime.datetime - :ivar feature_window_start: Specifies the feature window start time. - :vartype feature_window_start: ~datetime.datetime - """ - - feature_window_end: Optional[datetime.datetime] = rest_field( - name="featureWindowEnd", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Specifies the feature window end time.""" - feature_window_start: Optional[datetime.datetime] = rest_field( - name="featureWindowStart", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Specifies the feature window start time.""" - - @overload - def __init__( - self, - *, - feature_window_end: Optional[datetime.datetime] = None, - feature_window_start: Optional[datetime.datetime] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FeaturizationSettings(_Model): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - dataset_language: Optional[str] = rest_field( - name="datasetLanguage", visibility=["read", "create", "update", "delete", "query"] - ) - """Dataset language, useful for the text data.""" - - @overload - def __init__( - self, - *, - dataset_language: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FinetuningDetails(_Model): - """FinetuningDetails. - - :ivar hyper_parameters: Finetuning Hyperparameters. - :vartype hyper_parameters: dict[str, str] - :ivar student_model: [Required] Student model for fine tuning. Required. - :vartype student_model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - """ - - hyper_parameters: Optional[dict[str, str]] = rest_field( - name="hyperParameters", visibility=["read", "create", "update", "delete", "query"] - ) - """Finetuning Hyperparameters.""" - student_model: "_models.JobInput" = rest_field( - name="studentModel", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Student model for fine tuning. Required.""" - - @overload - def __init__( - self, - *, - student_model: "_models.JobInput", - hyper_parameters: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FineTuningJob(JobBaseProperties, discriminator="FineTuning"): - """FineTuning Job definition. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - :ivar fine_tuning_details: [Required]. Required. - :vartype fine_tuning_details: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FineTuningVertical - :ivar outputs: [Required]. Required. - :vartype outputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QueueSettings - :ivar resources: Instance types and other resources for the job. - :vartype resources: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobResources - :ivar job_type: [Required] Specifies the type of job. Required. FINE_TUNING. - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FINE_TUNING - """ - - fine_tuning_details: "_models.FineTuningVertical" = rest_field( - name="fineTuningDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required]. Required.""" - outputs: dict[str, "_models.JobOutput"] = rest_field(visibility=["read", "create"]) - """[Required]. Required.""" - queue_settings: Optional["_models.QueueSettings"] = rest_field(name="queueSettings", visibility=["read", "create"]) - """Queue settings for the job.""" - resources: Optional["_models.JobResources"] = rest_field(visibility=["read", "create"]) - """Instance types and other resources for the job.""" - job_type: Literal[JobType.FINE_TUNING] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. FINE_TUNING.""" - - @overload - def __init__( - self, - *, - fine_tuning_details: "_models.FineTuningVertical", - outputs: dict[str, "_models.JobOutput"], - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - queue_settings: Optional["_models.QueueSettings"] = None, - resources: Optional["_models.JobResources"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = JobType.FINE_TUNING # type: ignore - - -class MonitoringInputDataBase(_Model): - """Monitoring input data base definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FixedInputData, RollingInputData, StaticInputData - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar input_data_type: [Required] Specifies the type of signal to monitor. Required. Known - values are: "Static", "Rolling", and "Fixed". - :vartype input_data_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataType - :ivar job_input_type: [Required] Specifies the type of job. Required. Known values are: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", and - "triton_model". - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInputType - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - """ - - __mapping__: dict[str, _Model] = {} - columns: Optional[dict[str, str]] = rest_field(visibility=["read", "create"]) - """Mapping of column names to special uses.""" - data_context: Optional[str] = rest_field(name="dataContext", visibility=["read", "create"]) - """The context metadata of the data source.""" - input_data_type: str = rest_discriminator(name="inputDataType", visibility=["read", "create"]) - """[Required] Specifies the type of signal to monitor. Required. Known values are: \"Static\", - \"Rolling\", and \"Fixed\".""" - job_input_type: Union[str, "_models.JobInputType"] = rest_field(name="jobInputType", visibility=["read", "create"]) - """[Required] Specifies the type of job. Required. Known values are: \"literal\", \"uri_file\", - \"uri_folder\", \"mltable\", \"custom_model\", \"mlflow_model\", and \"triton_model\".""" - uri: str = rest_field(visibility=["read", "create"]) - """[Required] Input Asset URI. Required.""" - - @overload - def __init__( - self, - *, - input_data_type: str, - job_input_type: Union[str, "_models.JobInputType"], - uri: str, - columns: Optional[dict[str, str]] = None, - data_context: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FixedInputData(MonitoringInputDataBase, discriminator="Fixed"): - """Fixed input data definition. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar job_input_type: [Required] Specifies the type of job. Required. Known values are: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", and - "triton_model". - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInputType - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar input_data_type: [Required] Specifies the type of signal to monitor. Required. An input - data with tabular format which doesn't require preprocessing. - :vartype input_data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FIXED - """ - - input_data_type: Literal[MonitoringInputDataType.FIXED] = rest_discriminator(name="inputDataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. An input data with tabular format - which doesn't require preprocessing.""" - - @overload - def __init__( - self, - *, - job_input_type: Union[str, "_models.JobInputType"], - uri: str, - columns: Optional[dict[str, str]] = None, - data_context: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.input_data_type = MonitoringInputDataType.FIXED # type: ignore - - -class FlavorData(_Model): - """FlavorData. - - :ivar data: Model flavor-specific data. - :vartype data: dict[str, str] - """ - - data: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model flavor-specific data.""" - - @overload - def __init__( - self, - *, - data: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Forecasting(AutoMLVertical, discriminator="Forecasting"): - """Forecasting task in AutoML Table vertical. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar forecasting_settings: Forecasting task specific inputs. - :vartype forecasting_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ForecastingSettings - :ivar primary_metric: Primary metrics for Forecasting task. Known values are: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", and - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ForecastingPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ForecastingTrainingSettings - :ivar task_type: [Required] Task type for AutoMLJob. Required. Forecasting is a special kind of - regression task that deals with time-series data and creates forecasting model that can be used - to predict the near future values based on the inputs. - :vartype task_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FORECASTING - """ - - cv_split_column_names: Optional[list[str]] = rest_field( - name="cvSplitColumnNames", visibility=["read", "create", "update", "delete", "query"] - ) - """Columns to use for CVSplit data.""" - featurization_settings: Optional["_models.TableVerticalFeaturizationSettings"] = rest_field( - name="featurizationSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Featurization inputs needed for AutoML job.""" - limit_settings: Optional["_models.TableVerticalLimitSettings"] = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Execution constraints for AutoMLJob.""" - n_cross_validations: Optional["_models.NCrossValidations"] = rest_field( - name="nCrossValidations", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of cross validation folds to be applied on training dataset when validation dataset is - not provided.""" - test_data: Optional["_models.MLTableJobInput"] = rest_field( - name="testData", visibility=["read", "create", "update", "delete", "query"] - ) - """Test data input.""" - test_data_size: Optional[float] = rest_field( - name="testDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of test dataset that needs to be set aside for validation purpose. Values between - (0.0 , 1.0) Applied when validation dataset is not provided.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - validation_data_size: Optional[float] = rest_field( - name="validationDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of training dataset that needs to be set aside for validation purpose. Values - between (0.0 , 1.0) Applied when validation dataset is not provided.""" - weight_column_name: Optional[str] = rest_field( - name="weightColumnName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the sample weight column. Automated ML supports a weighted column as an input, - causing rows in the data to be weighted up or down.""" - forecasting_settings: Optional["_models.ForecastingSettings"] = rest_field( - name="forecastingSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Forecasting task specific inputs.""" - primary_metric: Optional[Union[str, "_models.ForecastingPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for Forecasting task. Known values are: \"SpearmanCorrelation\", - \"NormalizedRootMeanSquaredError\", \"R2Score\", and \"NormalizedMeanAbsoluteError\".""" - training_settings: Optional["_models.ForecastingTrainingSettings"] = rest_field( - name="trainingSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Inputs for training phase for an AutoML Job.""" - task_type: Literal[TaskType.FORECASTING] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Forecasting is a special kind of regression task - that deals with time-series data and creates forecasting model that can be used to predict the - near future values based on the inputs.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - cv_split_column_names: Optional[list[str]] = None, - featurization_settings: Optional["_models.TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["_models.TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["_models.NCrossValidations"] = None, - test_data: Optional["_models.MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - forecasting_settings: Optional["_models.ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "_models.ForecastingPrimaryMetrics"]] = None, - training_settings: Optional["_models.ForecastingTrainingSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.FORECASTING # type: ignore - - -class ForecastingSettings(_Model): - """Forecasting specific parameters. - - :ivar country_or_region_for_holidays: Country or region for holidays for forecasting tasks. - These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - :vartype country_or_region_for_holidays: str - :ivar cv_step_size: Number of periods between the origin time of one CV fold and the next fold. - For example, if ``CVStepSize`` = 3 for daily data, the origin time for each fold will be three - days apart. - :vartype cv_step_size: int - :ivar feature_lags: Flag for generating lags for the numeric features. Known values are: "None" - and "Auto". - :vartype feature_lags: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureLags - :ivar forecast_horizon: The desired maximum forecast horizon in units of time-series frequency. - :vartype forecast_horizon: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ForecastHorizon - :ivar frequency: When forecasting, this parameter represents the period with which the forecast - is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency - by default. - :vartype frequency: str - :ivar seasonality: Set time series seasonality as an integer multiple of the series frequency. - If seasonality is set to 'auto', it will be inferred. - :vartype seasonality: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Seasonality - :ivar short_series_handling_config: The parameter defining how if AutoML should handle short - time series. Known values are: "None", "Auto", "Pad", and "Drop". - :vartype short_series_handling_config: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ShortSeriesHandlingConfiguration - :ivar target_aggregate_function: Target aggregate function. Known values are: "None", "Sum", - "Max", "Min", and "Mean". - :vartype target_aggregate_function: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TargetAggregationFunction - :ivar target_lags: The number of past periods to lag from the target column. - :vartype target_lags: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TargetLags - :ivar target_rolling_window_size: The number of past periods used to create a rolling window - average of the target column. - :vartype target_rolling_window_size: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TargetRollingWindowSize - :ivar time_column_name: The name of the time column. This parameter is required when - forecasting to specify the datetime column in the input data used for building the time series - and inferring its frequency. - :vartype time_column_name: str - :ivar time_series_id_column_names: The names of columns used to group a timeseries. It can be - used to create multiple series. If grain is not defined, the data set is assumed to be one - time-series. This parameter is used with task type forecasting. - :vartype time_series_id_column_names: list[str] - :ivar use_stl: Configure STL Decomposition of the time-series target column. Known values are: - "None", "Season", and "SeasonTrend". - :vartype use_stl: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UseStl - """ - - country_or_region_for_holidays: Optional[str] = rest_field( - name="countryOrRegionForHolidays", visibility=["read", "create", "update", "delete", "query"] - ) - """Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter - country/region codes, for example 'US' or 'GB'.""" - cv_step_size: Optional[int] = rest_field( - name="cvStepSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of periods between the origin time of one CV fold and the next fold. For example, if - ``CVStepSize`` = 3 for daily data, the origin time for each fold will be three days apart.""" - feature_lags: Optional[Union[str, "_models.FeatureLags"]] = rest_field( - name="featureLags", visibility=["read", "create", "update", "delete", "query"] - ) - """Flag for generating lags for the numeric features. Known values are: \"None\" and \"Auto\".""" - forecast_horizon: Optional["_models.ForecastHorizon"] = rest_field( - name="forecastHorizon", visibility=["read", "create", "update", "delete", "query"] - ) - """The desired maximum forecast horizon in units of time-series frequency.""" - frequency: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """When forecasting, this parameter represents the period with which the forecast is desired, for - example daily, weekly, yearly, etc. The forecast frequency is dataset frequency by default.""" - seasonality: Optional["_models.Seasonality"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Set time series seasonality as an integer multiple of the series frequency. If seasonality is - set to 'auto', it will be inferred.""" - short_series_handling_config: Optional[Union[str, "_models.ShortSeriesHandlingConfiguration"]] = rest_field( - name="shortSeriesHandlingConfig", visibility=["read", "create", "update", "delete", "query"] - ) - """The parameter defining how if AutoML should handle short time series. Known values are: - \"None\", \"Auto\", \"Pad\", and \"Drop\".""" - target_aggregate_function: Optional[Union[str, "_models.TargetAggregationFunction"]] = rest_field( - name="targetAggregateFunction", visibility=["read", "create", "update", "delete", "query"] - ) - """Target aggregate function. Known values are: \"None\", \"Sum\", \"Max\", \"Min\", and \"Mean\".""" - target_lags: Optional["_models.TargetLags"] = rest_field( - name="targetLags", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of past periods to lag from the target column.""" - target_rolling_window_size: Optional["_models.TargetRollingWindowSize"] = rest_field( - name="targetRollingWindowSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of past periods used to create a rolling window average of the target column.""" - time_column_name: Optional[str] = rest_field( - name="timeColumnName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the time column. This parameter is required when forecasting to specify the - datetime column in the input data used for building the time series and inferring its - frequency.""" - time_series_id_column_names: Optional[list[str]] = rest_field( - name="timeSeriesIdColumnNames", visibility=["read", "create", "update", "delete", "query"] - ) - """The names of columns used to group a timeseries. It can be used to create multiple series. If - grain is not defined, the data set is assumed to be one time-series. This parameter is used - with task type forecasting.""" - use_stl: Optional[Union[str, "_models.UseStl"]] = rest_field( - name="useStl", visibility=["read", "create", "update", "delete", "query"] - ) - """Configure STL Decomposition of the time-series target column. Known values are: \"None\", - \"Season\", and \"SeasonTrend\".""" - - @overload - def __init__( - self, - *, - country_or_region_for_holidays: Optional[str] = None, - cv_step_size: Optional[int] = None, - feature_lags: Optional[Union[str, "_models.FeatureLags"]] = None, - forecast_horizon: Optional["_models.ForecastHorizon"] = None, - frequency: Optional[str] = None, - seasonality: Optional["_models.Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "_models.ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "_models.TargetAggregationFunction"]] = None, - target_lags: Optional["_models.TargetLags"] = None, - target_rolling_window_size: Optional["_models.TargetRollingWindowSize"] = None, - time_column_name: Optional[str] = None, - time_series_id_column_names: Optional[list[str]] = None, - use_stl: Optional[Union[str, "_models.UseStl"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ForecastingTrainingSettings(TrainingSettings): - """Forecasting Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. Configure this - parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for forecasting task. - :vartype allowed_training_algorithms: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ForecastingModels] - :ivar blocked_training_algorithms: Blocked models for forecasting task. - :vartype blocked_training_algorithms: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ForecastingModels] - """ - - allowed_training_algorithms: Optional[list[Union[str, "_models.ForecastingModels"]]] = rest_field( - name="allowedTrainingAlgorithms", visibility=["read", "create", "update", "delete", "query"] - ) - """Allowed models for forecasting task.""" - blocked_training_algorithms: Optional[list[Union[str, "_models.ForecastingModels"]]] = rest_field( - name="blockedTrainingAlgorithms", visibility=["read", "create", "update", "delete", "query"] - ) - """Blocked models for forecasting task.""" - - @overload - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = None, - enable_model_explainability: Optional[bool] = None, - enable_onnx_compatible_models: Optional[bool] = None, - enable_stack_ensemble: Optional[bool] = None, - enable_vote_ensemble: Optional[bool] = None, - ensemble_model_download_timeout: Optional[datetime.timedelta] = None, - stack_ensemble_settings: Optional["_models.StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[list[Union[str, "_models.ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[list[Union[str, "_models.ForecastingModels"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FQDNEndpoint(_Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FQDNEndpointDetail] - """ - - domain_name: Optional[str] = rest_field( - name="domainName", visibility=["read", "create", "update", "delete", "query"] - ) - endpoint_details: Optional[list["_models.FQDNEndpointDetail"]] = rest_field( - name="endpointDetails", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[list["_models.FQDNEndpointDetail"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FQDNEndpointDetail(_Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - port: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FQDNEndpoints(_Model): - """FQDNEndpoints. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FQDNEndpoint] - """ - - category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - endpoints: Optional[list["_models.FQDNEndpoint"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[list["_models.FQDNEndpoint"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FQDNEndpointsPropertyBag(_Model): - """Property bag for FQDN endpoints result. - - :ivar properties: - :vartype properties: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FQDNEndpoints - """ - - properties: Optional["_models.FQDNEndpoints"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - properties: Optional["_models.FQDNEndpoints"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OutboundRule(_Model): - """Outbound Rule for the managed network of a machine learning workspace. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Known values are: "Required", "Recommended", "UserDefined", and "Dependency". - :vartype category: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Known - values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleStatus - :ivar type: Type of a managed network Outbound Rule of a machine learning workspace. Required. - Known values are: "FQDN", "PrivateEndpoint", and "ServiceTag". - :vartype type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleType - :ivar error_information: Error information about an outbound rule of a machine learning - workspace if RuleStatus is failed. - :vartype error_information: str - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - """ - - __mapping__: dict[str, _Model] = {} - category: Optional[Union[str, "_models.RuleCategory"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Category of a managed network Outbound Rule of a machine learning workspace. Known values are: - \"Required\", \"Recommended\", \"UserDefined\", and \"Dependency\".""" - status: Optional[Union[str, "_models.RuleStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of a managed network Outbound Rule of a machine learning workspace. Known values are: - \"Inactive\", \"Active\", \"Provisioning\", \"Deleting\", and \"Failed\".""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of a managed network Outbound Rule of a machine learning workspace. Required. Known values - are: \"FQDN\", \"PrivateEndpoint\", and \"ServiceTag\".""" - error_information: Optional[str] = rest_field(name="errorInformation", visibility=["read"]) - """Error information about an outbound rule of a machine learning workspace if RuleStatus is - failed.""" - parent_rule_names: Optional[list[str]] = rest_field(name="parentRuleNames", visibility=["read"]) - - @overload - def __init__( - self, - *, - type: str, - category: Optional[Union[str, "_models.RuleCategory"]] = None, - status: Optional[Union[str, "_models.RuleStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FqdnOutboundRule(OutboundRule, discriminator="FQDN"): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Known values are: "Required", "Recommended", "UserDefined", and "Dependency". - :vartype category: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Known - values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleStatus - :ivar error_information: Error information about an outbound rule of a machine learning - workspace if RuleStatus is failed. - :vartype error_information: str - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar destination: - :vartype destination: str - :ivar type: Type of a managed network Outbound Rule of a machine learning workspace. Required. - FQDN. - :vartype type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FQDN - """ - - destination: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[RuleType.FQDN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of a managed network Outbound Rule of a machine learning workspace. Required. FQDN.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.RuleCategory"]] = None, - status: Optional[Union[str, "_models.RuleStatus"]] = None, - destination: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = RuleType.FQDN # type: ignore - - -class GetBlobReferenceForConsumptionDto(_Model): - """GetBlobReferenceForConsumptionDto. - - :ivar blob_uri: Blob uri, example: `https://blob.windows.core.net/Container/Path - `_. - :vartype blob_uri: str - :ivar credential: Credential info to access storage account. - :vartype credential: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataReferenceCredential - :ivar storage_account_arm_id: The ARM id of the storage account. - :vartype storage_account_arm_id: str - """ - - blob_uri: Optional[str] = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob uri, example: `https://blob.windows.core.net/Container/Path - `_.""" - credential: Optional["_models.DataReferenceCredential"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Credential info to access storage account.""" - storage_account_arm_id: Optional[str] = rest_field( - name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """The ARM id of the storage account.""" - - @overload - def __init__( - self, - *, - blob_uri: Optional[str] = None, - credential: Optional["_models.DataReferenceCredential"] = None, - storage_account_arm_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class GetBlobReferenceSASRequestDto(_Model): - """BlobReferenceSASRequest for getBlobReferenceSAS API. - - :ivar asset_id: Id of the asset to be accessed. - :vartype asset_id: str - :ivar blob_uri: Blob uri of the asset to be accessed. - :vartype blob_uri: str - """ - - asset_id: Optional[str] = rest_field(name="assetId", visibility=["read", "create", "update", "delete", "query"]) - """Id of the asset to be accessed.""" - blob_uri: Optional[str] = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob uri of the asset to be accessed.""" - - @overload - def __init__( - self, - *, - asset_id: Optional[str] = None, - blob_uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class GetBlobReferenceSASResponseDto(_Model): - """BlobReferenceSASResponse for getBlobReferenceSAS API. - - :ivar blob_reference_for_consumption: Blob reference for consumption details. - :vartype blob_reference_for_consumption: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceForConsumptionDto - """ - - blob_reference_for_consumption: Optional["_models.GetBlobReferenceForConsumptionDto"] = rest_field( - name="blobReferenceForConsumption", visibility=["read", "create", "update", "delete", "query"] - ) - """Blob reference for consumption details.""" - - @overload - def __init__( - self, - *, - blob_reference_for_consumption: Optional["_models.GetBlobReferenceForConsumptionDto"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class GridSamplingAlgorithm(SamplingAlgorithm, discriminator="Grid"): - """Defines a Sampling Algorithm that exhaustively generates every value combination in the space. - - :ivar sampling_algorithm_type: [Required] The algorithm used for generating hyperparameter - values, along with configuration properties. Required. GRID. - :vartype sampling_algorithm_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GRID - """ - - sampling_algorithm_type: Literal[SamplingAlgorithmType.GRID] = rest_discriminator(name="samplingAlgorithmType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] The algorithm used for generating hyperparameter values, along with configuration - properties. Required. GRID.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.sampling_algorithm_type = SamplingAlgorithmType.GRID # type: ignore - - -class GroupEnvironmentConfiguration(_Model): - """Environment configuration options. - - :ivar environment_id: ARM resource ID of the environment specification for the inference pool. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the inference pool. - :vartype environment_variables: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StringStringKeyValuePair] - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar startup_probe: This verifies whether the application within a container is started. - Startup probes run before any other probe, and, unless it finishes successfully, disables other - probes. - :vartype startup_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - """ - - environment_id: Optional[str] = rest_field( - name="environmentId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM resource ID of the environment specification for the inference pool.""" - environment_variables: Optional[list["_models.StringStringKeyValuePair"]] = rest_field( - name="environmentVariables", visibility=["read", "create", "update", "delete", "query"] - ) - """Environment variables configuration for the inference pool.""" - liveness_probe: Optional["_models.ProbeSettings"] = rest_field( - name="livenessProbe", visibility=["read", "create", "update", "delete", "query"] - ) - """Liveness probe monitors the health of the container regularly.""" - readiness_probe: Optional["_models.ProbeSettings"] = rest_field( - name="readinessProbe", visibility=["read", "create", "update", "delete", "query"] - ) - """Readiness probe validates if the container is ready to serve traffic. The properties and - defaults are the same as liveness probe.""" - startup_probe: Optional["_models.ProbeSettings"] = rest_field( - name="startupProbe", visibility=["read", "create", "update", "delete", "query"] - ) - """This verifies whether the application within a container is started. Startup probes run before - any other probe, and, unless it finishes successfully, disables other probes.""" - - @overload - def __init__( - self, - *, - environment_id: Optional[str] = None, - environment_variables: Optional[list["_models.StringStringKeyValuePair"]] = None, - liveness_probe: Optional["_models.ProbeSettings"] = None, - readiness_probe: Optional["_models.ProbeSettings"] = None, - startup_probe: Optional["_models.ProbeSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class GroupModelConfiguration(_Model): - """Model configuration options. - - :ivar model_id: The URI path to the model. - :vartype model_id: str - """ - - model_id: Optional[str] = rest_field(name="modelId", visibility=["read", "create", "update", "delete", "query"]) - """The URI path to the model.""" - - @overload - def __init__( - self, - *, - model_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class GroupStatus(_Model): - """GroupStatus. - - :ivar actual_capacity_info: Gets or sets the actual capacity info for the group. - :vartype actual_capacity_info: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ActualCapacityInfo - :ivar endpoint_count: Gets or sets the actual number of endpoints in the group. - :vartype endpoint_count: int - :ivar requested_capacity: Gets or sets the request number of instances for the group. - :vartype requested_capacity: int - """ - - actual_capacity_info: Optional["_models.ActualCapacityInfo"] = rest_field( - name="actualCapacityInfo", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the actual capacity info for the group.""" - endpoint_count: Optional[int] = rest_field( - name="endpointCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the actual number of endpoints in the group.""" - requested_capacity: Optional[int] = rest_field( - name="requestedCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the request number of instances for the group.""" - - @overload - def __init__( - self, - *, - actual_capacity_info: Optional["_models.ActualCapacityInfo"] = None, - endpoint_count: Optional[int] = None, - requested_capacity: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class HDInsight(Compute, discriminator="HDInsight"): - """A HDInsight compute. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.HDInsightProperties - :ivar compute_type: The type of compute. Required. HD_INSIGHT. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.HD_INSIGHT - """ - - properties: Optional["_models.HDInsightProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - compute_type: Literal[ComputeType.HD_INSIGHT] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. HD_INSIGHT.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.HDInsightProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.HD_INSIGHT # type: ignore - - -class HDInsightProperties(_Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSshCredentials - """ - - ssh_port: Optional[int] = rest_field(name="sshPort", visibility=["read", "create", "update", "delete", "query"]) - """Port open for ssh connections on the master node of the cluster.""" - address: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Public IP address of the master node of the cluster.""" - administrator_account: Optional["_models.VirtualMachineSshCredentials"] = rest_field( - name="administratorAccount", visibility=["read", "create", "update", "delete", "query"] - ) - """Admin credentials for master node of the cluster.""" - - @overload - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["_models.VirtualMachineSshCredentials"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class IdAssetReference(AssetReferenceBase, discriminator="Id"): - """Reference to an asset via its ARM resource ID. - - :ivar asset_id: [Required] ARM resource ID of the asset. Required. - :vartype asset_id: str - :ivar reference_type: [Required] Specifies the type of asset reference. Required. ID. - :vartype reference_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ID - """ - - asset_id: str = rest_field(name="assetId", visibility=["read", "create", "update", "delete", "query"]) - """[Required] ARM resource ID of the asset. Required.""" - reference_type: Literal[ReferenceType.ID] = rest_discriminator(name="referenceType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of asset reference. Required. ID.""" - - @overload - def __init__( - self, - *, - asset_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.reference_type = ReferenceType.ID # type: ignore - - -class IdentityForCmk(_Model): - """Identity object used for encryption. - - :ivar user_assigned_identity: UserAssignedIdentity to be used to fetch the encryption key from - keyVault. - :vartype user_assigned_identity: str - """ - - user_assigned_identity: Optional[str] = rest_field( - name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """UserAssignedIdentity to be used to fetch the encryption key from keyVault.""" - - @overload - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class IdleShutdownSetting(_Model): - """Stops compute instance after user defined period of inactivity. - - :ivar idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum - is 3 days. - :vartype idle_time_before_shutdown: str - """ - - idle_time_before_shutdown: Optional[str] = rest_field( - name="idleTimeBeforeShutdown", visibility=["read", "create", "update", "delete", "query"] - ) - """Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days.""" - - @overload - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Image(_Model): - """Image. - - :ivar type: Type of the image. Known values are: "docker" and "azureml". - :vartype type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageType - :ivar reference: Image reference URL if type is docker. Environment name if type is azureml. - :vartype reference: str - :ivar version: Version of image being used. If latest then skip this field. - :vartype version: str - """ - - type: Optional[Union[str, "_models.ImageType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of the image. Known values are: \"docker\" and \"azureml\".""" - reference: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Image reference URL if type is docker. Environment name if type is azureml.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of image being used. If latest then skip this field.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.ImageType"]] = None, - reference: Optional[str] = None, - version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageClassification(AutoMLVertical, discriminator="ImageClassification"): - """Image Classification. Multi-class image classification is used when an image is classified with - only a single label from a set of classes - e.g. each image is classified as either an image of - a 'cat' or a 'dog' or a 'duck'. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelDistributionSettingsClassification] - :ivar limit_settings: [Required] Limit settings for the AutoML job. Required. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar primary_metric: Primary metrics for classification tasks. Known values are: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", and - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationPrimaryMetrics - :ivar task_type: [Required] Task type for AutoMLJob. Required. Image Classification. - Multi-class image classification is used when an image is classified with only a single label - from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' - or a 'duck'. - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IMAGE_CLASSIFICATION - """ - - model_settings: Optional["_models.ImageModelSettingsClassification"] = rest_field( - name="modelSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings used for training the model.""" - search_space: Optional[list["_models.ImageModelDistributionSettingsClassification"]] = rest_field( - name="searchSpace", visibility=["read", "create", "update", "delete", "query"] - ) - """Search space for sampling different combinations of models and their hyperparameters.""" - limit_settings: "_models.ImageLimitSettings" = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Limit settings for the AutoML job. Required.""" - sweep_settings: Optional["_models.ImageSweepSettings"] = rest_field( - name="sweepSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Model sweeping and hyperparameter sweeping related settings.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - validation_data_size: Optional[float] = rest_field( - name="validationDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of training dataset that needs to be set aside for validation purpose. Values - between (0.0 , 1.0) Applied when validation dataset is not provided.""" - primary_metric: Optional[Union[str, "_models.ClassificationPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for classification tasks. Known values are: \"AUCWeighted\", \"Accuracy\", - \"NormMacroRecall\", \"AveragePrecisionScoreWeighted\", and \"PrecisionScoreWeighted\".""" - task_type: Literal[TaskType.IMAGE_CLASSIFICATION] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Image Classification. Multi-class image - classification is used when an image is classified with only a single label from a set of - classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - limit_settings: "_models.ImageLimitSettings", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - model_settings: Optional["_models.ImageModelSettingsClassification"] = None, - search_space: Optional[list["_models.ImageModelDistributionSettingsClassification"]] = None, - sweep_settings: Optional["_models.ImageSweepSettings"] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - primary_metric: Optional[Union[str, "_models.ClassificationPrimaryMetrics"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.IMAGE_CLASSIFICATION # type: ignore - - -class ImageClassificationMultilabel(AutoMLVertical, discriminator="ImageClassificationMultilabel"): - """Image Classification Multilabel. Multi-label image classification is used when an image could - have one or more labels from a set of labels - e.g. an image could be labeled with both 'cat' - and 'dog'. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelDistributionSettingsClassification] - :ivar limit_settings: [Required] Limit settings for the AutoML job. Required. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar primary_metric: Primary metrics for classification multilabel tasks. Known values are: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", and "IOU". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationMultilabelPrimaryMetrics - :ivar task_type: [Required] Task type for AutoMLJob. Required. Image Classification Multilabel. - Multi-label image classification is used when an image could have one or more labels from a set - of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IMAGE_CLASSIFICATION_MULTILABEL - """ - - model_settings: Optional["_models.ImageModelSettingsClassification"] = rest_field( - name="modelSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings used for training the model.""" - search_space: Optional[list["_models.ImageModelDistributionSettingsClassification"]] = rest_field( - name="searchSpace", visibility=["read", "create", "update", "delete", "query"] - ) - """Search space for sampling different combinations of models and their hyperparameters.""" - limit_settings: "_models.ImageLimitSettings" = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Limit settings for the AutoML job. Required.""" - sweep_settings: Optional["_models.ImageSweepSettings"] = rest_field( - name="sweepSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Model sweeping and hyperparameter sweeping related settings.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - validation_data_size: Optional[float] = rest_field( - name="validationDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of training dataset that needs to be set aside for validation purpose. Values - between (0.0 , 1.0) Applied when validation dataset is not provided.""" - primary_metric: Optional[Union[str, "_models.ClassificationMultilabelPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for classification multilabel tasks. Known values are: \"AUCWeighted\", - \"Accuracy\", \"NormMacroRecall\", \"AveragePrecisionScoreWeighted\", - \"PrecisionScoreWeighted\", and \"IOU\".""" - task_type: Literal[TaskType.IMAGE_CLASSIFICATION_MULTILABEL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Image Classification Multilabel. Multi-label - image classification is used when an image could have one or more labels from a set of labels - - e.g. an image could be labeled with both 'cat' and 'dog'.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - limit_settings: "_models.ImageLimitSettings", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - model_settings: Optional["_models.ImageModelSettingsClassification"] = None, - search_space: Optional[list["_models.ImageModelDistributionSettingsClassification"]] = None, - sweep_settings: Optional["_models.ImageSweepSettings"] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - primary_metric: Optional[Union[str, "_models.ClassificationMultilabelPrimaryMetrics"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.IMAGE_CLASSIFICATION_MULTILABEL # type: ignore - - -class ImageDetails(_Model): - """ImageDetails. - - :ivar exists: Indicates if image exists. - :vartype exists: bool - :ivar image: Container image details. - :vartype image: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageInfo - :ivar vulnerability_findings: Vulnerability findings details. - :vartype vulnerability_findings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VulnerabilityFindings - """ - - exists: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates if image exists.""" - image: Optional["_models.ImageInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Container image details.""" - vulnerability_findings: Optional["_models.VulnerabilityFindings"] = rest_field( - name="vulnerabilityFindings", visibility=["read", "create", "update", "delete", "query"] - ) - """Vulnerability findings details.""" - - @overload - def __init__( - self, - *, - exists: Optional[bool] = None, - image: Optional["_models.ImageInfo"] = None, - vulnerability_findings: Optional["_models.VulnerabilityFindings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageInfo(_Model): - """ImageInfo. - - :ivar digest: Image digest. - :vartype digest: str - :ivar hostname: Container registry host name. - :vartype hostname: str - :ivar repository: Repository name. - :vartype repository: str - :ivar tag: Image tag. - :vartype tag: str - """ - - digest: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Image digest.""" - hostname: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Container registry host name.""" - repository: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Repository name.""" - tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Image tag.""" - - @overload - def __init__( - self, - *, - digest: Optional[str] = None, - hostname: Optional[str] = None, - repository: Optional[str] = None, - tag: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageInstanceSegmentation(AutoMLVertical, discriminator="ImageInstanceSegmentation"): - """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at - the pixel level, drawing a polygon around each object in the image. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelDistributionSettingsObjectDetection] - :ivar limit_settings: [Required] Limit settings for the AutoML job. Required. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar primary_metric: Primary metrics for InstanceSegmentation tasks. "MeanAveragePrecision" - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InstanceSegmentationPrimaryMetrics - :ivar task_type: [Required] Task type for AutoMLJob. Required. Image Instance Segmentation. - Instance segmentation is used to identify objects in an image at the pixel level, drawing a - polygon around each object in the image. - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IMAGE_INSTANCE_SEGMENTATION - """ - - model_settings: Optional["_models.ImageModelSettingsObjectDetection"] = rest_field( - name="modelSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings used for training the model.""" - search_space: Optional[list["_models.ImageModelDistributionSettingsObjectDetection"]] = rest_field( - name="searchSpace", visibility=["read", "create", "update", "delete", "query"] - ) - """Search space for sampling different combinations of models and their hyperparameters.""" - limit_settings: "_models.ImageLimitSettings" = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Limit settings for the AutoML job. Required.""" - sweep_settings: Optional["_models.ImageSweepSettings"] = rest_field( - name="sweepSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Model sweeping and hyperparameter sweeping related settings.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - validation_data_size: Optional[float] = rest_field( - name="validationDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of training dataset that needs to be set aside for validation purpose. Values - between (0.0 , 1.0) Applied when validation dataset is not provided.""" - primary_metric: Optional[Union[str, "_models.InstanceSegmentationPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for InstanceSegmentation tasks. \"MeanAveragePrecision\"""" - task_type: Literal[TaskType.IMAGE_INSTANCE_SEGMENTATION] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Image Instance Segmentation. Instance - segmentation is used to identify objects in an image at the pixel level, drawing a polygon - around each object in the image.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - limit_settings: "_models.ImageLimitSettings", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - model_settings: Optional["_models.ImageModelSettingsObjectDetection"] = None, - search_space: Optional[list["_models.ImageModelDistributionSettingsObjectDetection"]] = None, - sweep_settings: Optional["_models.ImageSweepSettings"] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - primary_metric: Optional[Union[str, "_models.InstanceSegmentationPrimaryMetrics"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.IMAGE_INSTANCE_SEGMENTATION # type: ignore - - -class ImageLimitSettings(_Model): - """Limit settings for the AutoML job. - - :ivar max_concurrent_trials: Maximum number of concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Maximum number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - max_concurrent_trials: Optional[int] = rest_field( - name="maxConcurrentTrials", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of concurrent AutoML iterations.""" - max_trials: Optional[int] = rest_field(name="maxTrials", visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of AutoML iterations.""" - timeout: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """AutoML job timeout.""" - - @overload - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = None, - max_trials: Optional[int] = None, - timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageMetadata(_Model): - """Returns metadata about the operating system image for this compute instance. - - :ivar current_image_version: Specifies the current operating system image version this compute - instance is running on. - :vartype current_image_version: str - :ivar latest_image_version: Specifies the latest available operating system image version. - :vartype latest_image_version: str - :ivar is_latest_os_image_version: Specifies whether this compute instance is running on the - latest operating system image. - :vartype is_latest_os_image_version: bool - :ivar os_patching_status: Metadata about the os patching. - :vartype os_patching_status: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OsPatchingStatus - """ - - current_image_version: Optional[str] = rest_field( - name="currentImageVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the current operating system image version this compute instance is running on.""" - latest_image_version: Optional[str] = rest_field( - name="latestImageVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the latest available operating system image version.""" - is_latest_os_image_version: Optional[bool] = rest_field( - name="isLatestOsImageVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies whether this compute instance is running on the latest operating system image.""" - os_patching_status: Optional["_models.OsPatchingStatus"] = rest_field(name="osPatchingStatus", visibility=["read"]) - """Metadata about the os patching.""" - - @overload - def __init__( - self, - *, - current_image_version: Optional[str] = None, - latest_image_version: Optional[str] = None, - is_latest_os_image_version: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageModelDistributionSettings(_Model): - """Distribution expressions to sweep over values of model settings. Some examples are: - - .. code-block:: - - ModelName = "choice('seresnext', 'resnest50')"; - LearningRate = "uniform(0.001, 0.01)"; - LayersToFreeze = "choice(0, 2)"; - ``` - All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., - valn) - where distribution name can be: uniform, quniform, loguniform, etc - For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters - For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without updating the model weights while accumulating the - gradients of those steps, and then using the accumulated gradients to compute the weight - updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full - list of models supported and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. For more information on the available - models please visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - ams_gradient: Optional[str] = rest_field( - name="amsGradient", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable AMSGrad when optimizer is 'adam' or 'adamw'.""" - augmentations: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Settings for using Augmentations.""" - beta1: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].""" - beta2: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].""" - distributed: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to use distributer training.""" - early_stopping: Optional[str] = rest_field( - name="earlyStopping", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable early stopping logic during training.""" - early_stopping_delay: Optional[str] = rest_field( - name="earlyStoppingDelay", visibility=["read", "create", "update", "delete", "query"] - ) - """Minimum number of epochs or validation evaluations to wait before primary metric improvement is - tracked for early stopping. Must be a positive integer.""" - early_stopping_patience: Optional[str] = rest_field( - name="earlyStoppingPatience", visibility=["read", "create", "update", "delete", "query"] - ) - """Minimum number of epochs or validation evaluations with no primary metric improvement before - the run is stopped. Must be a positive integer.""" - enable_onnx_normalization: Optional[str] = rest_field( - name="enableOnnxNormalization", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable normalization when exporting ONNX model.""" - evaluation_frequency: Optional[str] = rest_field( - name="evaluationFrequency", visibility=["read", "create", "update", "delete", "query"] - ) - """Frequency to evaluate validation dataset to get metric scores. Must be a positive integer.""" - gradient_accumulation_step: Optional[str] = rest_field( - name="gradientAccumulationStep", visibility=["read", "create", "update", "delete", "query"] - ) - """Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps - without updating the model weights while accumulating the gradients of those steps, and then - using the accumulated gradients to compute the weight updates. Must be a positive integer.""" - layers_to_freeze: Optional[str] = rest_field( - name="layersToFreeze", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of layers to freeze for the model. Must be a positive integer. For instance, passing 2 - as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported - and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_.""" - learning_rate: Optional[str] = rest_field( - name="learningRate", visibility=["read", "create", "update", "delete", "query"] - ) - """Initial learning rate. Must be a float in the range [0, 1].""" - learning_rate_scheduler: Optional[str] = rest_field( - name="learningRateScheduler", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'.""" - model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the model to use for training. For more information on the available models please - visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_.""" - momentum: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1].""" - nesterov: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Enable nesterov when optimizer is 'sgd'.""" - number_of_epochs: Optional[str] = rest_field( - name="numberOfEpochs", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of training epochs. Must be a positive integer.""" - number_of_workers: Optional[str] = rest_field( - name="numberOfWorkers", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of data loader workers. Must be a non-negative integer.""" - optimizer: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'.""" - random_seed: Optional[str] = rest_field( - name="randomSeed", visibility=["read", "create", "update", "delete", "query"] - ) - """Random seed to be used when using deterministic training.""" - step_lr_gamma: Optional[str] = rest_field( - name="stepLRGamma", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1].""" - step_lr_step_size: Optional[str] = rest_field( - name="stepLRStepSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of step size when learning rate scheduler is 'step'. Must be a positive integer.""" - training_batch_size: Optional[str] = rest_field( - name="trainingBatchSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Training batch size. Must be a positive integer.""" - validation_batch_size: Optional[str] = rest_field( - name="validationBatchSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation batch size. Must be a positive integer.""" - warmup_cosine_lr_cycles: Optional[str] = rest_field( - name="warmupCosineLRCycles", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the - range [0, 1].""" - warmup_cosine_lr_warmup_epochs: Optional[str] = rest_field( - name="warmupCosineLRWarmupEpochs", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive - integer.""" - weight_decay: Optional[str] = rest_field( - name="weightDecay", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the - range[0, 1].""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): # pylint: disable=name-too-long - """Distribution expressions to sweep over values of model settings. Some examples are: - - .. code-block:: - - ModelName = "choice('seresnext', 'resnest50')"; - LearningRate = "uniform(0.001, 0.01)"; - LayersToFreeze = "choice(0, 2)"; - ``` - For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters - For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without updating the model weights while accumulating the - gradients of those steps, and then using the accumulated gradients to compute the weight - updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full - list of models supported and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. For more information on the available - models please visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. 1 for - weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 - or 2. - :vartype weighted_loss: str - """ - - training_crop_size: Optional[str] = rest_field( - name="trainingCropSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Image crop size that is input to the neural network for the training dataset. Must be a - positive integer.""" - validation_crop_size: Optional[str] = rest_field( - name="validationCropSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Image crop size that is input to the neural network for the validation dataset. Must be a - positive integer.""" - validation_resize_size: Optional[str] = rest_field( - name="validationResizeSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Image size to which to resize before cropping for validation dataset. Must be a positive - integer.""" - weighted_loss: Optional[str] = rest_field( - name="weightedLoss", visibility=["read", "create", "update", "delete", "query"] - ) - """Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss with - sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2.""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - training_crop_size: Optional[str] = None, - validation_crop_size: Optional[str] = None, - validation_resize_size: Optional[str] = None, - weighted_loss: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): # pylint: disable=name-too-long - """Distribution expressions to sweep over values of model settings. Some examples are: - - .. code-block:: - - ModelName = "choice('seresnext', 'resnest50')"; - LearningRate = "uniform(0.001, 0.01)"; - LayersToFreeze = "choice(0, 2)"; - ``` - For more details on how to compose distribution expressions please check the documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters - For more information on the available settings please visit the official documentation: - https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without updating the model weights while accumulating the - gradients of those steps, and then using the accumulated gradients to compute the weight - updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full - list of models supported and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. For more information on the available - models please visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. Note: The - training run may get into CUDA OOM if the size is too big. Note: This settings is only - supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. Note: training - run may get into CUDA OOM if the model size is too big. Note: This settings is only supported - for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. Note: training - run may get into CUDA OOM if no sufficient GPU memory. Note: This settings is only supported - for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. Used in validation/ inference. Must be float in the range [0, - 1]. Note: This settings is not supported for the 'yolov5' algorithm. NMS: Non-maximum - suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - box_detections_per_image: Optional[str] = rest_field( - name="boxDetectionsPerImage", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of detections per image, for all classes. Must be a positive integer. Note: This - settings is not supported for the 'yolov5' algorithm.""" - box_score_threshold: Optional[str] = rest_field( - name="boxScoreThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """During inference, only return proposals with a classification score greater than - BoxScoreThreshold. Must be a float in the range[0, 1].""" - image_size: Optional[str] = rest_field(name="imageSize", visibility=["read", "create", "update", "delete", "query"]) - """Image size for train and validation. Must be a positive integer. Note: The training run may get - into CUDA OOM if the size is too big. Note: This settings is only supported for the 'yolov5' - algorithm.""" - max_size: Optional[str] = rest_field(name="maxSize", visibility=["read", "create", "update", "delete", "query"]) - """Maximum size of the image to be rescaled before feeding it to the backbone. Must be a positive - integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings - is not supported for the 'yolov5' algorithm.""" - min_size: Optional[str] = rest_field(name="minSize", visibility=["read", "create", "update", "delete", "query"]) - """Minimum size of the image to be rescaled before feeding it to the backbone. Must be a positive - integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings - is not supported for the 'yolov5' algorithm.""" - model_size: Optional[str] = rest_field(name="modelSize", visibility=["read", "create", "update", "delete", "query"]) - """Model size. Must be 'small', 'medium', 'large', or 'xlarge'. Note: training run may get into - CUDA OOM if the model size is too big. Note: This settings is only supported for the 'yolov5' - algorithm.""" - multi_scale: Optional[str] = rest_field( - name="multiScale", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable multi-scale image by varying image size by +/- 50%. Note: training run may get into CUDA - OOM if no sufficient GPU memory. Note: This settings is only supported for the 'yolov5' - algorithm.""" - nms_iou_threshold: Optional[str] = rest_field( - name="nmsIouThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """IOU threshold used during inference in NMS post processing. Must be float in the range [0, 1].""" - tile_grid_size: Optional[str] = rest_field( - name="tileGridSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The grid size to use for tiling each image. Note: TileGridSize must not be None to enable small - object detection logic. A string containing two integers in mxn format. Note: This settings is - not supported for the 'yolov5' algorithm.""" - tile_overlap_ratio: Optional[str] = rest_field( - name="tileOverlapRatio", visibility=["read", "create", "update", "delete", "query"] - ) - """Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm.""" - tile_predictions_nms_threshold: Optional[str] = rest_field( - name="tilePredictionsNmsThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """The IOU threshold to use to perform NMS while merging predictions from tiles and image. Used in - validation/ inference. Must be float in the range [0, 1]. Note: This settings is not supported - for the 'yolov5' algorithm. NMS: Non-maximum suppression.""" - validation_iou_threshold: Optional[str] = rest_field( - name="validationIouThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """IOU threshold to use when computing validation metric. Must be float in the range [0, 1].""" - validation_metric_type: Optional[str] = rest_field( - name="validationMetricType", visibility=["read", "create", "update", "delete", "query"] - ) - """Metric computation method to use for validation metrics. Must be 'none', 'coco', 'voc', or - 'coco_voc'.""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - ams_gradient: Optional[str] = None, - augmentations: Optional[str] = None, - beta1: Optional[str] = None, - beta2: Optional[str] = None, - distributed: Optional[str] = None, - early_stopping: Optional[str] = None, - early_stopping_delay: Optional[str] = None, - early_stopping_patience: Optional[str] = None, - enable_onnx_normalization: Optional[str] = None, - evaluation_frequency: Optional[str] = None, - gradient_accumulation_step: Optional[str] = None, - layers_to_freeze: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - momentum: Optional[str] = None, - nesterov: Optional[str] = None, - number_of_epochs: Optional[str] = None, - number_of_workers: Optional[str] = None, - optimizer: Optional[str] = None, - random_seed: Optional[str] = None, - step_lr_gamma: Optional[str] = None, - step_lr_step_size: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_cosine_lr_cycles: Optional[str] = None, - warmup_cosine_lr_warmup_epochs: Optional[str] = None, - weight_decay: Optional[str] = None, - box_detections_per_image: Optional[str] = None, - box_score_threshold: Optional[str] = None, - image_size: Optional[str] = None, - max_size: Optional[str] = None, - min_size: Optional[str] = None, - model_size: Optional[str] = None, - multi_scale: Optional[str] = None, - nms_iou_threshold: Optional[str] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[str] = None, - tile_predictions_nms_threshold: Optional[str] = None, - validation_iou_threshold: Optional[str] = None, - validation_metric_type: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageModelSettings(_Model): - """Settings used for training the model. For more information on the available settings please - visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without updating the model weights while accumulating the - gradients of those steps, and then using the accumulated gradients to compute the weight - updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full - list of models supported and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Learning rate scheduler enum. Known values are: "None", - "WarmupCosine", and "Step". - :vartype learning_rate_scheduler: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. For more information on the available - models please visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Stochastic optimizer for image models. Known values are: "None", "Sgd", - "Adam", and "Adamw". - :vartype optimizer: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - advanced_settings: Optional[str] = rest_field( - name="advancedSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings for advanced scenarios.""" - ams_gradient: Optional[bool] = rest_field( - name="amsGradient", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable AMSGrad when optimizer is 'adam' or 'adamw'.""" - augmentations: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Settings for using Augmentations.""" - beta1: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].""" - beta2: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1].""" - checkpoint_frequency: Optional[int] = rest_field( - name="checkpointFrequency", visibility=["read", "create", "update", "delete", "query"] - ) - """Frequency to store model checkpoints. Must be a positive integer.""" - checkpoint_model: Optional["_models.MLFlowModelJobInput"] = rest_field( - name="checkpointModel", visibility=["read", "create", "update", "delete", "query"] - ) - """The pretrained checkpoint model for incremental training.""" - checkpoint_run_id: Optional[str] = rest_field( - name="checkpointRunId", visibility=["read", "create", "update", "delete", "query"] - ) - """The id of a previous run that has a pretrained checkpoint for incremental training.""" - distributed: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to use distributed training.""" - early_stopping: Optional[bool] = rest_field( - name="earlyStopping", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable early stopping logic during training.""" - early_stopping_delay: Optional[int] = rest_field( - name="earlyStoppingDelay", visibility=["read", "create", "update", "delete", "query"] - ) - """Minimum number of epochs or validation evaluations to wait before primary metric improvement is - tracked for early stopping. Must be a positive integer.""" - early_stopping_patience: Optional[int] = rest_field( - name="earlyStoppingPatience", visibility=["read", "create", "update", "delete", "query"] - ) - """Minimum number of epochs or validation evaluations with no primary metric improvement before - the run is stopped. Must be a positive integer.""" - enable_onnx_normalization: Optional[bool] = rest_field( - name="enableOnnxNormalization", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable normalization when exporting ONNX model.""" - evaluation_frequency: Optional[int] = rest_field( - name="evaluationFrequency", visibility=["read", "create", "update", "delete", "query"] - ) - """Frequency to evaluate validation dataset to get metric scores. Must be a positive integer.""" - gradient_accumulation_step: Optional[int] = rest_field( - name="gradientAccumulationStep", visibility=["read", "create", "update", "delete", "query"] - ) - """Gradient accumulation means running a configured number of \"GradAccumulationStep\" steps - without updating the model weights while accumulating the gradients of those steps, and then - using the accumulated gradients to compute the weight updates. Must be a positive integer.""" - layers_to_freeze: Optional[int] = rest_field( - name="layersToFreeze", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of layers to freeze for the model. Must be a positive integer. For instance, passing 2 - as value for 'seresnext' means freezing layer0 and layer1. For a full list of models supported - and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_.""" - learning_rate: Optional[float] = rest_field( - name="learningRate", visibility=["read", "create", "update", "delete", "query"] - ) - """Initial learning rate. Must be a float in the range [0, 1].""" - learning_rate_scheduler: Optional[Union[str, "_models.LearningRateScheduler"]] = rest_field( - name="learningRateScheduler", visibility=["read", "create", "update", "delete", "query"] - ) - """Learning rate scheduler enum. Known values are: \"None\", \"WarmupCosine\", and \"Step\".""" - model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the model to use for training. For more information on the available models please - visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_.""" - momentum: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1].""" - nesterov: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Enable nesterov when optimizer is 'sgd'.""" - number_of_epochs: Optional[int] = rest_field( - name="numberOfEpochs", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of training epochs. Must be a positive integer.""" - number_of_workers: Optional[int] = rest_field( - name="numberOfWorkers", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of data loader workers. Must be a non-negative integer.""" - optimizer: Optional[Union[str, "_models.StochasticOptimizer"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Stochastic optimizer for image models. Known values are: \"None\", \"Sgd\", \"Adam\", and - \"Adamw\".""" - random_seed: Optional[int] = rest_field( - name="randomSeed", visibility=["read", "create", "update", "delete", "query"] - ) - """Random seed to be used when using deterministic training.""" - step_lr_gamma: Optional[float] = rest_field( - name="stepLRGamma", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1].""" - step_lr_step_size: Optional[int] = rest_field( - name="stepLRStepSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of step size when learning rate scheduler is 'step'. Must be a positive integer.""" - training_batch_size: Optional[int] = rest_field( - name="trainingBatchSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Training batch size. Must be a positive integer.""" - validation_batch_size: Optional[int] = rest_field( - name="validationBatchSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation batch size. Must be a positive integer.""" - warmup_cosine_lr_cycles: Optional[float] = rest_field( - name="warmupCosineLRCycles", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the - range [0, 1].""" - warmup_cosine_lr_warmup_epochs: Optional[int] = rest_field( - name="warmupCosineLRWarmupEpochs", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive - integer.""" - weight_decay: Optional[float] = rest_field( - name="weightDecay", visibility=["read", "create", "update", "delete", "query"] - ) - """Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the - range[0, 1].""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["_models.MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "_models.LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "_models.StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageModelSettingsClassification(ImageModelSettings): - """Settings used for training the model. For more information on the available settings please - visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without updating the model weights while accumulating the - gradients of those steps, and then using the accumulated gradients to compute the weight - updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full - list of models supported and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Learning rate scheduler enum. Known values are: "None", - "WarmupCosine", and "Step". - :vartype learning_rate_scheduler: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. For more information on the available - models please visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Stochastic optimizer for image models. Known values are: "None", "Sgd", - "Adam", and "Adamw". - :vartype optimizer: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. 1 for - weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 - or 2. - :vartype weighted_loss: int - """ - - training_crop_size: Optional[int] = rest_field( - name="trainingCropSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Image crop size that is input to the neural network for the training dataset. Must be a - positive integer.""" - validation_crop_size: Optional[int] = rest_field( - name="validationCropSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Image crop size that is input to the neural network for the validation dataset. Must be a - positive integer.""" - validation_resize_size: Optional[int] = rest_field( - name="validationResizeSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Image size to which to resize before cropping for validation dataset. Must be a positive - integer.""" - weighted_loss: Optional[int] = rest_field( - name="weightedLoss", visibility=["read", "create", "update", "delete", "query"] - ) - """Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss with - sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2.""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["_models.MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "_models.LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "_models.StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - training_crop_size: Optional[int] = None, - validation_crop_size: Optional[int] = None, - validation_resize_size: Optional[int] = None, - weighted_loss: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. For more information on the available settings please - visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without updating the model weights while accumulating the - gradients of those steps, and then using the accumulated gradients to compute the weight - updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full - list of models supported and details on layer freeze, please see: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Learning rate scheduler enum. Known values are: "None", - "WarmupCosine", and "Step". - :vartype learning_rate_scheduler: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. For more information on the available - models please visit the official documentation: - `https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models - `_. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Stochastic optimizer for image models. Known values are: "None", "Sgd", - "Adam", and "Adamw". - :vartype optimizer: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. Note: The - training run may get into CUDA OOM if the size is too big. Note: This settings is only - supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Image model size. Known values are: "None", "Small", "Medium", "Large", and - "ExtraLarge". - :vartype model_size: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. Note: training - run may get into CUDA OOM if no sufficient GPU memory. Note: This settings is only supported - for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. Used in validation/ inference. Must be float in the range [0, - 1]. Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics in image - tasks. Known values are: "None", "Coco", "Voc", and "CocoVoc". - :vartype validation_metric_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ValidationMetricType - """ - - box_detections_per_image: Optional[int] = rest_field( - name="boxDetectionsPerImage", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of detections per image, for all classes. Must be a positive integer. Note: This - settings is not supported for the 'yolov5' algorithm.""" - box_score_threshold: Optional[float] = rest_field( - name="boxScoreThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """During inference, only return proposals with a classification score greater than - BoxScoreThreshold. Must be a float in the range[0, 1].""" - image_size: Optional[int] = rest_field(name="imageSize", visibility=["read", "create", "update", "delete", "query"]) - """Image size for train and validation. Must be a positive integer. Note: The training run may get - into CUDA OOM if the size is too big. Note: This settings is only supported for the 'yolov5' - algorithm.""" - max_size: Optional[int] = rest_field(name="maxSize", visibility=["read", "create", "update", "delete", "query"]) - """Maximum size of the image to be rescaled before feeding it to the backbone. Must be a positive - integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings - is not supported for the 'yolov5' algorithm.""" - min_size: Optional[int] = rest_field(name="minSize", visibility=["read", "create", "update", "delete", "query"]) - """Minimum size of the image to be rescaled before feeding it to the backbone. Must be a positive - integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings - is not supported for the 'yolov5' algorithm.""" - model_size: Optional[Union[str, "_models.ModelSize"]] = rest_field( - name="modelSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Image model size. Known values are: \"None\", \"Small\", \"Medium\", \"Large\", and - \"ExtraLarge\".""" - multi_scale: Optional[bool] = rest_field( - name="multiScale", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable multi-scale image by varying image size by +/- 50%. Note: training run may get into CUDA - OOM if no sufficient GPU memory. Note: This settings is only supported for the 'yolov5' - algorithm.""" - nms_iou_threshold: Optional[float] = rest_field( - name="nmsIouThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """IOU threshold used during inference in NMS post processing. Must be a float in the range [0, - 1].""" - tile_grid_size: Optional[str] = rest_field( - name="tileGridSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The grid size to use for tiling each image. Note: TileGridSize must not be None to enable small - object detection logic. A string containing two integers in mxn format. Note: This settings is - not supported for the 'yolov5' algorithm.""" - tile_overlap_ratio: Optional[float] = rest_field( - name="tileOverlapRatio", visibility=["read", "create", "update", "delete", "query"] - ) - """Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm.""" - tile_predictions_nms_threshold: Optional[float] = rest_field( - name="tilePredictionsNmsThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """The IOU threshold to use to perform NMS while merging predictions from tiles and image. Used in - validation/ inference. Must be float in the range [0, 1]. Note: This settings is not supported - for the 'yolov5' algorithm.""" - validation_iou_threshold: Optional[float] = rest_field( - name="validationIouThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """IOU threshold to use when computing validation metric. Must be float in the range [0, 1].""" - validation_metric_type: Optional[Union[str, "_models.ValidationMetricType"]] = rest_field( - name="validationMetricType", visibility=["read", "create", "update", "delete", "query"] - ) - """Metric computation method to use for validation metrics in image tasks. Known values are: - \"None\", \"Coco\", \"Voc\", and \"CocoVoc\".""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - advanced_settings: Optional[str] = None, - ams_gradient: Optional[bool] = None, - augmentations: Optional[str] = None, - beta1: Optional[float] = None, - beta2: Optional[float] = None, - checkpoint_frequency: Optional[int] = None, - checkpoint_model: Optional["_models.MLFlowModelJobInput"] = None, - checkpoint_run_id: Optional[str] = None, - distributed: Optional[bool] = None, - early_stopping: Optional[bool] = None, - early_stopping_delay: Optional[int] = None, - early_stopping_patience: Optional[int] = None, - enable_onnx_normalization: Optional[bool] = None, - evaluation_frequency: Optional[int] = None, - gradient_accumulation_step: Optional[int] = None, - layers_to_freeze: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "_models.LearningRateScheduler"]] = None, - model_name: Optional[str] = None, - momentum: Optional[float] = None, - nesterov: Optional[bool] = None, - number_of_epochs: Optional[int] = None, - number_of_workers: Optional[int] = None, - optimizer: Optional[Union[str, "_models.StochasticOptimizer"]] = None, - random_seed: Optional[int] = None, - step_lr_gamma: Optional[float] = None, - step_lr_step_size: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_cosine_lr_cycles: Optional[float] = None, - warmup_cosine_lr_warmup_epochs: Optional[int] = None, - weight_decay: Optional[float] = None, - box_detections_per_image: Optional[int] = None, - box_score_threshold: Optional[float] = None, - image_size: Optional[int] = None, - max_size: Optional[int] = None, - min_size: Optional[int] = None, - model_size: Optional[Union[str, "_models.ModelSize"]] = None, - multi_scale: Optional[bool] = None, - nms_iou_threshold: Optional[float] = None, - tile_grid_size: Optional[str] = None, - tile_overlap_ratio: Optional[float] = None, - tile_predictions_nms_threshold: Optional[float] = None, - validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "_models.ValidationMetricType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageObjectDetection(AutoMLVertical, discriminator="ImageObjectDetection"): - """Image Object Detection. Object detection is used to identify objects in an image and locate - each object with a bounding box e.g. locate all dogs and cats in an image and draw a bounding - box around each. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageModelDistributionSettingsObjectDetection] - :ivar limit_settings: [Required] Limit settings for the AutoML job. Required. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar primary_metric: Primary metrics for Image ObjectDetection task. "MeanAveragePrecision" - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ObjectDetectionPrimaryMetrics - :ivar task_type: [Required] Task type for AutoMLJob. Required. Image Object Detection. Object - detection is used to identify objects in an image and locate each object with a bounding box - e.g. locate all dogs and cats in an image and draw a bounding box around each. - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IMAGE_OBJECT_DETECTION - """ - - model_settings: Optional["_models.ImageModelSettingsObjectDetection"] = rest_field( - name="modelSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings used for training the model.""" - search_space: Optional[list["_models.ImageModelDistributionSettingsObjectDetection"]] = rest_field( - name="searchSpace", visibility=["read", "create", "update", "delete", "query"] - ) - """Search space for sampling different combinations of models and their hyperparameters.""" - limit_settings: "_models.ImageLimitSettings" = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Limit settings for the AutoML job. Required.""" - sweep_settings: Optional["_models.ImageSweepSettings"] = rest_field( - name="sweepSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Model sweeping and hyperparameter sweeping related settings.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - validation_data_size: Optional[float] = rest_field( - name="validationDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of training dataset that needs to be set aside for validation purpose. Values - between (0.0 , 1.0) Applied when validation dataset is not provided.""" - primary_metric: Optional[Union[str, "_models.ObjectDetectionPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for Image ObjectDetection task. \"MeanAveragePrecision\"""" - task_type: Literal[TaskType.IMAGE_OBJECT_DETECTION] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Image Object Detection. Object detection is used - to identify objects in an image and locate each object with a bounding box e.g. locate all dogs - and cats in an image and draw a bounding box around each.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - limit_settings: "_models.ImageLimitSettings", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - model_settings: Optional["_models.ImageModelSettingsObjectDetection"] = None, - search_space: Optional[list["_models.ImageModelDistributionSettingsObjectDetection"]] = None, - sweep_settings: Optional["_models.ImageSweepSettings"] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - primary_metric: Optional[Union[str, "_models.ObjectDetectionPrimaryMetrics"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.IMAGE_OBJECT_DETECTION # type: ignore - - -class ImageSweepSettings(_Model): - """Model sweeping and hyperparameter sweeping related settings. - - :ivar early_termination: Type of early termination policy. - :vartype early_termination: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EarlyTerminationPolicy - :ivar sampling_algorithm: [Required] Type of the hyperparameter sampling algorithms. Required. - Known values are: "Grid", "Random", and "Bayesian". - :vartype sampling_algorithm: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SamplingAlgorithmType - """ - - early_termination: Optional["_models.EarlyTerminationPolicy"] = rest_field( - name="earlyTermination", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of early termination policy.""" - sampling_algorithm: Union[str, "_models.SamplingAlgorithmType"] = rest_field( - name="samplingAlgorithm", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Type of the hyperparameter sampling algorithms. Required. Known values are: - \"Grid\", \"Random\", and \"Bayesian\".""" - - @overload - def __init__( - self, - *, - sampling_algorithm: Union[str, "_models.SamplingAlgorithmType"], - early_termination: Optional["_models.EarlyTerminationPolicy"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class IndexColumn(_Model): - """DTO object representing index column. - - :ivar column_name: Specifies the column name. - :vartype column_name: str - :ivar data_type: Specifies the data type. Known values are: "String", "Integer", "Long", - "Float", "Double", "Binary", "Datetime", and "Boolean". - :vartype data_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureDataType - """ - - column_name: Optional[str] = rest_field( - name="columnName", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the column name.""" - data_type: Optional[Union[str, "_models.FeatureDataType"]] = rest_field( - name="dataType", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the data type. Known values are: \"String\", \"Integer\", \"Long\", \"Float\", - \"Double\", \"Binary\", \"Datetime\", and \"Boolean\".""" - - @overload - def __init__( - self, - *, - column_name: Optional[str] = None, - data_type: Optional[Union[str, "_models.FeatureDataType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InferenceContainerProperties(_Model): - """InferenceContainerProperties. - - :ivar liveness_route: The route to check the liveness of the inference server container. - :vartype liveness_route: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Route - :ivar readiness_route: The route to check the readiness of the inference server container. - :vartype readiness_route: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Route - :ivar scoring_route: The port to send the scoring requests to, within the inference server - container. - :vartype scoring_route: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Route - :ivar startup_route: The route to check the startup of the application in the container. - :vartype startup_route: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Route - """ - - liveness_route: Optional["_models.Route"] = rest_field( - name="livenessRoute", visibility=["read", "create", "update", "delete", "query"] - ) - """The route to check the liveness of the inference server container.""" - readiness_route: Optional["_models.Route"] = rest_field( - name="readinessRoute", visibility=["read", "create", "update", "delete", "query"] - ) - """The route to check the readiness of the inference server container.""" - scoring_route: Optional["_models.Route"] = rest_field( - name="scoringRoute", visibility=["read", "create", "update", "delete", "query"] - ) - """The port to send the scoring requests to, within the inference server container.""" - startup_route: Optional["_models.Route"] = rest_field( - name="startupRoute", visibility=["read", "create", "update", "delete", "query"] - ) - """The route to check the startup of the application in the container.""" - - @overload - def __init__( - self, - *, - liveness_route: Optional["_models.Route"] = None, - readiness_route: Optional["_models.Route"] = None, - scoring_route: Optional["_models.Route"] = None, - startup_route: Optional["_models.Route"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InferenceEndpoint(TrackedResource): - """InferenceEndpoint is a preview-only resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpointProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.InferenceEndpointProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.InferenceEndpointProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PropertiesBase(_Model): - """Base definition for pool resources. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StringStringKeyValuePair] - """ - - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the resource.""" - properties: Optional[list["_models.StringStringKeyValuePair"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Property dictionary. Properties can be added, but not removed or altered.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[list["_models.StringStringKeyValuePair"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InferenceEndpointProperties(PropertiesBase): - """InferenceEndpoint configuration. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StringStringKeyValuePair] - :ivar auth_mode: [Required] Authentication mode for the endpoint. Required. "AAD" - :vartype auth_mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AuthMode - :ivar endpoint_uri: Endpoint URI for the inference endpoint. - :vartype endpoint_uri: str - :ivar group_name: [Required] Group within the same pool with which this endpoint needs to be - associated with. Required. - :vartype group_name: str - :ivar provisioning_state: Provisioning state for the endpoint. Known values are: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PoolProvisioningState - :ivar request_configuration: RequestConfiguration for endpoint. - :vartype request_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RequestConfiguration - """ - - auth_mode: Union[str, "_models.AuthMode"] = rest_field( - name="authMode", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Authentication mode for the endpoint. Required. \"AAD\"""" - endpoint_uri: Optional[str] = rest_field(name="endpointUri", visibility=["read"]) - """Endpoint URI for the inference endpoint.""" - group_name: str = rest_field(name="groupName", visibility=["read", "create", "update", "delete", "query"]) - """[Required] Group within the same pool with which this endpoint needs to be associated with. - Required.""" - provisioning_state: Optional[Union[str, "_models.PoolProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the endpoint. Known values are: \"Creating\", \"Deleting\", - \"Succeeded\", \"Failed\", \"Updating\", and \"Canceled\".""" - request_configuration: Optional["_models.RequestConfiguration"] = rest_field( - name="requestConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """RequestConfiguration for endpoint.""" - - @overload - def __init__( - self, - *, - auth_mode: Union[str, "_models.AuthMode"], - group_name: str, - description: Optional[str] = None, - properties: Optional[list["_models.StringStringKeyValuePair"]] = None, - request_configuration: Optional["_models.RequestConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InferenceGroup(TrackedResource): - """InferenceGroup is a preview-only resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroupProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.InferenceGroupProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.InferenceGroupProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InferenceGroupProperties(PropertiesBase): - """Inference group configuration. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StringStringKeyValuePair] - :ivar environment_configuration: Gets or sets environment configuration for the inference - group. Used if PoolType=ScaleUnit. - :vartype environment_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GroupEnvironmentConfiguration - :ivar model_configuration: Gets or sets model configuration for the inference group. Used if - PoolType=ScaleUnit. - :vartype model_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GroupModelConfiguration - :ivar node_sku_type: Gets or sets compute instance type. - :vartype node_sku_type: str - :ivar provisioning_state: Provisioning state for the inference group. Known values are: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PoolProvisioningState - :ivar scale_unit_size: Gets or sets Scale Unit size. - :vartype scale_unit_size: int - """ - - environment_configuration: Optional["_models.GroupEnvironmentConfiguration"] = rest_field( - name="environmentConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets environment configuration for the inference group. Used if PoolType=ScaleUnit.""" - model_configuration: Optional["_models.GroupModelConfiguration"] = rest_field( - name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets model configuration for the inference group. Used if PoolType=ScaleUnit.""" - node_sku_type: Optional[str] = rest_field( - name="nodeSkuType", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets compute instance type.""" - provisioning_state: Optional[Union[str, "_models.PoolProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the inference group. Known values are: \"Creating\", \"Deleting\", - \"Succeeded\", \"Failed\", \"Updating\", and \"Canceled\".""" - scale_unit_size: Optional[int] = rest_field( - name="scaleUnitSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets Scale Unit size.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[list["_models.StringStringKeyValuePair"]] = None, - environment_configuration: Optional["_models.GroupEnvironmentConfiguration"] = None, - model_configuration: Optional["_models.GroupModelConfiguration"] = None, - node_sku_type: Optional[str] = None, - scale_unit_size: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InferencePool(TrackedResource): - """InferencePool is a preview-only resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePoolProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.InferencePoolProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.InferencePoolProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InferencePoolProperties(PropertiesBase): - """Inference pool configuration. - - :ivar description: Description of the resource. - :vartype description: str - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StringStringKeyValuePair] - :ivar provisioning_state: Provisioning state for the pool. Known values are: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PoolProvisioningState - :ivar scale_unit_configuration: Gets or sets ScaleUnitConfiguration for the inference pool. - Used if PoolType=ScaleUnit. - :vartype scale_unit_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScaleUnitConfiguration - """ - - provisioning_state: Optional[Union[str, "_models.PoolProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the pool. Known values are: \"Creating\", \"Deleting\", \"Succeeded\", - \"Failed\", \"Updating\", and \"Canceled\".""" - scale_unit_configuration: Optional["_models.ScaleUnitConfiguration"] = rest_field( - name="scaleUnitConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets ScaleUnitConfiguration for the inference pool. Used if PoolType=ScaleUnit.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[list["_models.StringStringKeyValuePair"]] = None, - scale_unit_configuration: Optional["_models.ScaleUnitConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InstanceTypeSchema(_Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InstanceTypeSchemaResources - """ - - node_selector: Optional[dict[str, str]] = rest_field( - name="nodeSelector", visibility=["read", "create", "update", "delete", "query"] - ) - """Node Selector.""" - resources: Optional["_models.InstanceTypeSchemaResources"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Resource requests/limits for this instance type.""" - - @overload - def __init__( - self, - *, - node_selector: Optional[dict[str, str]] = None, - resources: Optional["_models.InstanceTypeSchemaResources"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InstanceTypeSchemaResources(_Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - requests: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource requests for this instance type.""" - limits: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource limits for this instance type.""" - - @overload - def __init__( - self, - *, - requests: Optional[dict[str, str]] = None, - limits: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class IPRule(_Model): - """Contains an IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or - '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' or 'Deny'. - - :ivar value: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) - or '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' or - 'Deny'. - :vartype value: str - """ - - value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or - '124.56.78.0/24' (all addresses that start with 124.56.78). Value could be 'Allow' or 'Deny'.""" - - @overload - def __init__( - self, - *, - value: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class JobBase(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBaseProperties - """ - - properties: "_models.JobBaseProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.JobBaseProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class JobResourceConfiguration(ResourceConfiguration): - """JobResourceConfiguration. - - :ivar instance_count: Optional number of instances or nodes used by the compute target. - :vartype instance_count: int - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - :ivar docker_args: Extra arguments to pass to the Docker run command. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types. - :vartype docker_args: str - :ivar docker_args_list: Extra arguments to pass to the Docker run command, as a collection. - This would override any parameters that have already been set by the system, or in this - section. This parameter is only supported for Azure ML compute types. - :vartype docker_args_list: list[str] - :ivar shm_size: Size of the docker container's shared memory block. This should be in the - format of (number)(unit) where number as to be greater than 0 and the unit can be one of - b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - :vartype shm_size: str - """ - - docker_args: Optional[str] = rest_field(name="dockerArgs", visibility=["read", "create"]) - """Extra arguments to pass to the Docker run command. This would override any parameters that have - already been set by the system, or in this section. This parameter is only supported for Azure - ML compute types.""" - docker_args_list: Optional[list[str]] = rest_field(name="dockerArgsList", visibility=["read", "create"]) - """Extra arguments to pass to the Docker run command, as a collection. This would override any - parameters that have already been set by the system, or in this section. This parameter is only - supported for Azure ML compute types.""" - shm_size: Optional[str] = rest_field(name="shmSize", visibility=["read", "create"]) - """Size of the docker container's shared memory block. This should be in the format of - (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), - k(kilobytes), m(megabytes), or g(gigabytes).""" - - @overload - def __init__( - self, - *, - instance_count: Optional[int] = None, - instance_type: Optional[str] = None, - properties: Optional[dict[str, Any]] = None, - docker_args: Optional[str] = None, - docker_args_list: Optional[list[str]] = None, - shm_size: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class JobResources(_Model): - """JobResources. - - :ivar instance_types: List of instance types to choose from. - :vartype instance_types: list[str] - """ - - instance_types: Optional[list[str]] = rest_field(name="instanceTypes", visibility=["read", "create"]) - """List of instance types to choose from.""" - - @overload - def __init__( - self, - *, - instance_types: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class JobScheduleAction(ScheduleActionBase, discriminator="CreateJob"): - """JobScheduleAction. - - :ivar job_definition: [Required] Defines Schedule action definition details. Required. - :vartype job_definition: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBaseProperties - :ivar action_type: [Required] Specifies the action type of the schedule. Required. CREATE_JOB. - :vartype action_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CREATE_JOB - """ - - job_definition: "_models.JobBaseProperties" = rest_field( - name="jobDefinition", visibility=["read", "create", "update"] - ) - """[Required] Defines Schedule action definition details. Required.""" - action_type: Literal[ScheduleActionType.CREATE_JOB] = rest_discriminator(name="actionType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the action type of the schedule. Required. CREATE_JOB.""" - - @overload - def __init__( - self, - *, - job_definition: "_models.JobBaseProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.action_type = ScheduleActionType.CREATE_JOB # type: ignore - - -class JobService(_Model): - """Job endpoint definition. - - :ivar endpoint: Url for endpoint. - :vartype endpoint: str - :ivar error_message: Any error in the service. - :vartype error_message: str - :ivar job_service_type: Endpoint type. - :vartype job_service_type: str - :ivar nodes: Nodes that user would like to start the service on. If Nodes is not set or set to - null, the service will only be started on leader node. - :vartype nodes: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Nodes - :ivar port: Port for endpoint. - :vartype port: int - :ivar properties: Additional properties to set on the endpoint. - :vartype properties: dict[str, str] - :ivar status: Status of endpoint. - :vartype status: str - """ - - endpoint: Optional[str] = rest_field(visibility=["read", "create"]) - """Url for endpoint.""" - error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) - """Any error in the service.""" - job_service_type: Optional[str] = rest_field(name="jobServiceType", visibility=["read", "create"]) - """Endpoint type.""" - nodes: Optional["_models.Nodes"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Nodes that user would like to start the service on. If Nodes is not set or set to null, the - service will only be started on leader node.""" - port: Optional[int] = rest_field(visibility=["read", "create"]) - """Port for endpoint.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties to set on the endpoint.""" - status: Optional[str] = rest_field(visibility=["read"]) - """Status of endpoint.""" - - @overload - def __init__( - self, - *, - endpoint: Optional[str] = None, - job_service_type: Optional[str] = None, - nodes: Optional["_models.Nodes"] = None, - port: Optional[int] = None, - properties: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class JupyterKernelConfig(_Model): - """Jupyter kernel configuration. - - :ivar argv: Argument to the the runtime. - :vartype argv: list[str] - :ivar display_name: Display name of the kernel. - :vartype display_name: str - :ivar language: Language of the kernel [Example value: python]. - :vartype language: str - """ - - argv: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Argument to the the runtime.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Display name of the kernel.""" - language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Language of the kernel [Example value: python].""" - - @overload - def __init__( - self, - *, - argv: Optional[list[str]] = None, - display_name: Optional[str] = None, - language: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class KeyVaultProperties(_Model): - """Customer Key vault properties. - - :ivar identity_client_id: Currently, we support only SystemAssigned MSI. We need this when we - support UserAssignedIdentities. - :vartype identity_client_id: str - :ivar key_identifier: KeyVault key identifier to encrypt the data. Required. - :vartype key_identifier: str - :ivar key_vault_arm_id: KeyVault Arm Id that contains the data encryption key. Required. - :vartype key_vault_arm_id: str - """ - - identity_client_id: Optional[str] = rest_field( - name="identityClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """Currently, we support only SystemAssigned MSI. We need this when we support - UserAssignedIdentities.""" - key_identifier: str = rest_field(name="keyIdentifier", visibility=["read", "create", "update", "delete", "query"]) - """KeyVault key identifier to encrypt the data. Required.""" - key_vault_arm_id: str = rest_field(name="keyVaultArmId", visibility=["read", "create", "update", "delete", "query"]) - """KeyVault Arm Id that contains the data encryption key. Required.""" - - @overload - def __init__( - self, - *, - key_identifier: str, - key_vault_arm_id: str, - identity_client_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Kubernetes(Compute, discriminator="Kubernetes"): - """A Machine Learning compute based on Kubernetes Compute. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of Kubernetes. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.KubernetesProperties - :ivar compute_type: The type of compute. Required. KUBERNETES. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.KUBERNETES - """ - - properties: Optional["_models.KubernetesProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of Kubernetes.""" - compute_type: Literal[ComputeType.KUBERNETES] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. KUBERNETES.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.KubernetesProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.KUBERNETES # type: ignore - - -class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): - """OnlineDeploymentProperties. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - KubernetesOnlineDeployment, ManagedOnlineDeployment - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataCollector - :ivar egress_public_network_access: Enum to determine whether PublicNetworkAccess is Enabled or - Disabled for egress of a deployment. Known values are: "Enabled" and "Disabled". - :vartype egress_public_network_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EgressPublicNetworkAccessType - :ivar endpoint_compute_type: [Required] The compute type of the endpoint. Required. Known - values are: "Managed", "Kubernetes", and "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointComputeType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Known values are: - "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. If it is null or not provided, it - defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment and to - DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineScaleSettings - :ivar startup_probe: Startup probe verify whether an application within a container has started - successfully. - :vartype startup_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - """ - - __mapping__: dict[str, _Model] = {} - app_insights_enabled: Optional[bool] = rest_field( - name="appInsightsEnabled", visibility=["read", "create", "update", "delete", "query"] - ) - """If true, enables Application Insights logging.""" - data_collector: Optional["_models.DataCollector"] = rest_field( - name="dataCollector", visibility=["read", "create", "update", "delete", "query"] - ) - """The mdc configuration, we disable mdc when it's null.""" - egress_public_network_access: Optional[Union[str, "_models.EgressPublicNetworkAccessType"]] = rest_field( - name="egressPublicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a - deployment. Known values are: \"Enabled\" and \"Disabled\".""" - endpoint_compute_type: str = rest_discriminator( - name="endpointComputeType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The compute type of the endpoint. Required. Known values are: \"Managed\", - \"Kubernetes\", and \"AzureMLCompute\".""" - instance_type: Optional[str] = rest_field(name="instanceType", visibility=["read", "create"]) - """Compute instance type. Default: Standard_F4s_v2.""" - liveness_probe: Optional["_models.ProbeSettings"] = rest_field( - name="livenessProbe", visibility=["read", "create", "update", "delete", "query"] - ) - """Liveness probe monitors the health of the container regularly.""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URI path to the model.""" - model_mount_path: Optional[str] = rest_field( - name="modelMountPath", visibility=["read", "create", "update", "delete", "query"] - ) - """The path to mount the model in custom container.""" - provisioning_state: Optional[Union[str, "_models.DeploymentProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the endpoint deployment. Known values are: \"Creating\", \"Deleting\", - \"Scaling\", \"Updating\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - readiness_probe: Optional["_models.ProbeSettings"] = rest_field( - name="readinessProbe", visibility=["read", "create", "update", "delete", "query"] - ) - """Readiness probe validates if the container is ready to serve traffic. The properties and - defaults are the same as liveness probe.""" - request_settings: Optional["_models.OnlineRequestSettings"] = rest_field( - name="requestSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Request settings for the deployment.""" - scale_settings: Optional["_models.OnlineScaleSettings"] = rest_field( - name="scaleSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Scale settings for the deployment. If it is null or not provided, it defaults to - TargetUtilizationScaleSettings for KubernetesOnlineDeployment and to DefaultScaleSettings for - ManagedOnlineDeployment.""" - startup_probe: Optional["_models.ProbeSettings"] = rest_field( - name="startupProbe", visibility=["read", "create", "update", "delete", "query"] - ) - """Startup probe verify whether an application within a container has started successfully.""" - - @overload - def __init__( - self, - *, - endpoint_compute_type: str, - code_configuration: Optional["_models.CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, - app_insights_enabled: Optional[bool] = None, - data_collector: Optional["_models.DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "_models.EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["_models.ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["_models.ProbeSettings"] = None, - request_settings: Optional["_models.OnlineRequestSettings"] = None, - scale_settings: Optional["_models.OnlineScaleSettings"] = None, - startup_probe: Optional["_models.ProbeSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class KubernetesOnlineDeployment(OnlineDeploymentProperties, discriminator="Kubernetes"): - """Properties specific to a KubernetesOnlineDeployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataCollector - :ivar egress_public_network_access: Enum to determine whether PublicNetworkAccess is Enabled or - Disabled for egress of a deployment. Known values are: "Enabled" and "Disabled". - :vartype egress_public_network_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EgressPublicNetworkAccessType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Known values are: - "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. If it is null or not provided, it - defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment and to - DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineScaleSettings - :ivar startup_probe: Startup probe verify whether an application within a container has started - successfully. - :vartype startup_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar container_resource_requirements: The resource requirements for the container (cpu and - memory). - :vartype container_resource_requirements: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContainerResourceRequirements - :ivar endpoint_compute_type: [Required] The compute type of the endpoint. Required. KUBERNETES. - :vartype endpoint_compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.KUBERNETES - """ - - container_resource_requirements: Optional["_models.ContainerResourceRequirements"] = rest_field( - name="containerResourceRequirements", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource requirements for the container (cpu and memory).""" - endpoint_compute_type: Literal[EndpointComputeType.KUBERNETES] = rest_discriminator(name="endpointComputeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] The compute type of the endpoint. Required. KUBERNETES.""" - - @overload - def __init__( - self, - *, - code_configuration: Optional["_models.CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, - app_insights_enabled: Optional[bool] = None, - data_collector: Optional["_models.DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "_models.EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["_models.ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["_models.ProbeSettings"] = None, - request_settings: Optional["_models.OnlineRequestSettings"] = None, - scale_settings: Optional["_models.OnlineScaleSettings"] = None, - startup_probe: Optional["_models.ProbeSettings"] = None, - container_resource_requirements: Optional["_models.ContainerResourceRequirements"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.endpoint_compute_type = EndpointComputeType.KUBERNETES # type: ignore - - -class KubernetesProperties(_Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InstanceTypeSchema] - """ - - relay_connection_string: Optional[str] = rest_field( - name="relayConnectionString", visibility=["read", "create", "update", "delete", "query"] - ) - """Relay connection string.""" - service_bus_connection_string: Optional[str] = rest_field( - name="serviceBusConnectionString", visibility=["read", "create", "update", "delete", "query"] - ) - """ServiceBus connection string.""" - extension_principal_id: Optional[str] = rest_field( - name="extensionPrincipalId", visibility=["read", "create", "update", "delete", "query"] - ) - """Extension principal-id.""" - extension_instance_release_train: Optional[str] = rest_field( - name="extensionInstanceReleaseTrain", visibility=["read", "create", "update", "delete", "query"] - ) - """Extension instance release train.""" - vc_name: Optional[str] = rest_field(name="vcName", visibility=["read", "create", "update", "delete", "query"]) - """VC name.""" - namespace: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Compute namespace.""" - default_instance_type: Optional[str] = rest_field( - name="defaultInstanceType", visibility=["read", "create", "update", "delete", "query"] - ) - """Default instance type.""" - instance_types: Optional[dict[str, "_models.InstanceTypeSchema"]] = rest_field( - name="instanceTypes", visibility=["read", "create", "update", "delete", "query"] - ) - """Instance Type Schema.""" - - @overload - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = None, - default_instance_type: Optional[str] = None, - instance_types: Optional[dict[str, "_models.InstanceTypeSchema"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LabelGeneration(DataGenerationVertical, discriminator="LabelGeneration"): - """LabelGeneration. - - :ivar data_generation_task_type: [Required] DataGeneration Task type. Required. Known values - are: "Conversation", "Math", "Nli", "NluQa", and "Summarization". - :vartype data_generation_task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataGenerationTaskType - :ivar prompt_settings: Prompt Settings. - :vartype prompt_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PromptSettings - :ivar teacher_model_endpoint: [Required] Teacher Model Endpoint Details. Required. - :vartype teacher_model_endpoint: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TeacherModelEndpoint - :ivar teacher_model_settings: - :vartype teacher_model_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TeacherModelSettings - :ivar training_data: Training data for fine tuning. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar validation_data: Validation data for fine tuning. - :vartype validation_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput - :ivar data_generation_type: [Required] Enum to determine the type of Data Generation. Required. - Label Generation by Teacher Model Inferencing. - :vartype data_generation_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LABEL_GENERATION - """ - - training_data: Optional["_models.JobInput"] = rest_field( - name="trainingData", visibility=["read", "create", "update", "delete", "query"] - ) - """Training data for fine tuning.""" - validation_data: Optional["_models.JobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data for fine tuning.""" - data_generation_type: Literal[DataGenerationType.LABEL_GENERATION] = rest_discriminator(name="dataGenerationType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Enum to determine the type of Data Generation. Required. Label Generation by Teacher - Model Inferencing.""" - - @overload - def __init__( - self, - *, - data_generation_task_type: Union[str, "_models.DataGenerationTaskType"], - teacher_model_endpoint: "_models.TeacherModelEndpoint", - prompt_settings: Optional["_models.PromptSettings"] = None, - teacher_model_settings: Optional["_models.TeacherModelSettings"] = None, - training_data: Optional["_models.JobInput"] = None, - validation_data: Optional["_models.JobInput"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_generation_type = DataGenerationType.LABEL_GENERATION # type: ignore - - -class OneLakeArtifact(_Model): - """OneLake artifact (data source) configuration. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - LakeHouseArtifact - - :ivar artifact_name: [Required] OneLake artifact name. Required. - :vartype artifact_name: str - :ivar artifact_type: [Required] OneLake artifact type. Required. "LakeHouse" - :vartype artifact_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OneLakeArtifactType - """ - - __mapping__: dict[str, _Model] = {} - artifact_name: str = rest_field(name="artifactName", visibility=["read", "create"]) - """[Required] OneLake artifact name. Required.""" - artifact_type: str = rest_discriminator( - name="artifactType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] OneLake artifact type. Required. \"LakeHouse\"""" - - @overload - def __init__( - self, - *, - artifact_name: str, - artifact_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LakeHouseArtifact(OneLakeArtifact, discriminator="LakeHouse"): - """LakeHouseArtifact. - - :ivar artifact_name: [Required] OneLake artifact name. Required. - :vartype artifact_name: str - :ivar artifact_type: [Required] OneLake artifact type. Required. LAKE_HOUSE. - :vartype artifact_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LAKE_HOUSE - """ - - artifact_type: Literal[OneLakeArtifactType.LAKE_HOUSE] = rest_discriminator(name="artifactType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] OneLake artifact type. Required. LAKE_HOUSE.""" - - @overload - def __init__( - self, - *, - artifact_name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.artifact_type = OneLakeArtifactType.LAKE_HOUSE # type: ignore - - -class ListNotebookKeysResult(_Model): - """ListNotebookKeysResult. - - :ivar primary_access_key: The primary access key of the Notebook. - :vartype primary_access_key: str - :ivar secondary_access_key: The secondary access key of the Notebook. - :vartype secondary_access_key: str - """ - - primary_access_key: Optional[str] = rest_field(name="primaryAccessKey", visibility=["read"]) - """The primary access key of the Notebook.""" - secondary_access_key: Optional[str] = rest_field(name="secondaryAccessKey", visibility=["read"]) - """The secondary access key of the Notebook.""" - - -class ListStorageAccountKeysResult(_Model): - """ListStorageAccountKeysResult. - - :ivar user_storage_key: The access key of the storage. - :vartype user_storage_key: str - """ - - user_storage_key: Optional[str] = rest_field(name="userStorageKey", visibility=["read"]) - """The access key of the storage.""" - - -class ListWorkspaceKeysResult(_Model): - """ListWorkspaceKeysResult. - - :ivar app_insights_instrumentation_key: The access key of the workspace app insights. - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListNotebookKeysResult - :ivar user_storage_arm_id: The arm Id key of the workspace storage. - :vartype user_storage_arm_id: str - :ivar user_storage_key: The access key of the workspace storage. - :vartype user_storage_key: str - """ - - app_insights_instrumentation_key: Optional[str] = rest_field( - name="appInsightsInstrumentationKey", visibility=["read"] - ) - """The access key of the workspace app insights.""" - container_registry_credentials: Optional["_models.RegistryListCredentialsResult"] = rest_field( - name="containerRegistryCredentials", visibility=["read", "create", "update", "delete", "query"] - ) - notebook_access_keys: Optional["_models.ListNotebookKeysResult"] = rest_field( - name="notebookAccessKeys", visibility=["read", "create", "update", "delete", "query"] - ) - user_storage_arm_id: Optional[str] = rest_field(name="userStorageArmId", visibility=["read"]) - """The arm Id key of the workspace storage.""" - user_storage_key: Optional[str] = rest_field(name="userStorageKey", visibility=["read"]) - """The access key of the workspace storage.""" - - @overload - def __init__( - self, - *, - container_registry_credentials: Optional["_models.RegistryListCredentialsResult"] = None, - notebook_access_keys: Optional["_models.ListNotebookKeysResult"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LiteralJobInput(JobInput, discriminator="literal"): - """Literal input type. - - :ivar description: Description for the input. - :vartype description: str - :ivar value: [Required] Literal value for the input. Required. - :vartype value: str - :ivar job_input_type: [Required] Specifies the type of job. Required. LITERAL. - :vartype job_input_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LITERAL - """ - - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Literal value for the input. Required.""" - job_input_type: Literal[JobInputType.LITERAL] = rest_discriminator(name="jobInputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. LITERAL.""" - - @overload - def __init__( - self, - *, - value: str, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_input_type = JobInputType.LITERAL # type: ignore - - -class ManagedComputeIdentity(MonitorComputeIdentityBase, discriminator="ManagedIdentity"): - """Managed compute identity definition. - - :ivar identity: The identity which will be leveraged by the monitoring jobs. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar compute_identity_type: [Required] Specifies the type of identity to use within the - monitoring jobs. Required. Authenticates through a user-provided managed identity. - :vartype compute_identity_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MANAGED_IDENTITY - """ - - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The identity which will be leveraged by the monitoring jobs.""" - compute_identity_type: Literal[MonitorComputeIdentityType.MANAGED_IDENTITY] = rest_discriminator(name="computeIdentityType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of identity to use within the monitoring jobs. Required. - Authenticates through a user-provided managed identity.""" - - @overload - def __init__( - self, - *, - identity: Optional["_models.ManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_identity_type = MonitorComputeIdentityType.MANAGED_IDENTITY # type: ignore - - -class ManagedIdentity(IdentityConfiguration, discriminator="Managed"): - """Managed identity configuration. - - :ivar client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not - set this field. - :vartype client_id: str - :ivar object_id: Specifies a user-assigned identity by object ID. For system-assigned, do not - set this field. - :vartype object_id: str - :ivar resource_id: Specifies a user-assigned identity by ARM resource ID. For system-assigned, - do not set this field. - :vartype resource_id: str - :ivar identity_type: [Required] Specifies the type of identity framework. Required. MANAGED. - :vartype identity_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MANAGED - """ - - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create"]) - """Specifies a user-assigned identity by client ID. For system-assigned, do not set this field.""" - object_id: Optional[str] = rest_field(name="objectId", visibility=["read", "create"]) - """Specifies a user-assigned identity by object ID. For system-assigned, do not set this field.""" - resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read", "create"]) - """Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not set this - field.""" - identity_type: Literal[IdentityConfigurationType.MANAGED] = rest_discriminator(name="identityType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of identity framework. Required. MANAGED.""" - - @overload - def __init__( - self, - *, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.identity_type = IdentityConfigurationType.MANAGED # type: ignore - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties( - WorkspaceConnectionPropertiesV2, discriminator="ManagedIdentity" -): # pylint: disable=name-too-long - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionManagedIdentity - :ivar auth_type: Authentication type of the connection target. Required. MANAGED_IDENTITY. - :vartype auth_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MANAGED_IDENTITY - """ - - credentials: Optional["_models.WorkspaceConnectionManagedIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.MANAGED_IDENTITY] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. MANAGED_IDENTITY.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionManagedIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.MANAGED_IDENTITY # type: ignore - - -class ManagedIdentityCredential(DataReferenceCredential, discriminator="ManagedIdentity"): - """Credential for user managed identity. - - :ivar managed_identity_type: ManagedIdentityCredential identity type. - :vartype managed_identity_type: str - :ivar user_managed_identity_client_id: ClientId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_client_id: str - :ivar user_managed_identity_principal_id: PrincipalId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_principal_id: str - :ivar user_managed_identity_resource_id: Full arm scope for the Id. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_resource_id: str - :ivar user_managed_identity_tenant_id: TenantId for the UAMI. For ManagedIdentityType = - SystemManaged, this field is null. - :vartype user_managed_identity_tenant_id: str - :ivar credential_type: [Required] Credential type used to authentication with storage. - Required. MANAGED_IDENTITY. - :vartype credential_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MANAGED_IDENTITY - """ - - managed_identity_type: Optional[str] = rest_field( - name="managedIdentityType", visibility=["read", "create", "update", "delete", "query"] - ) - """ManagedIdentityCredential identity type.""" - user_managed_identity_client_id: Optional[str] = rest_field( - name="userManagedIdentityClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null.""" - user_managed_identity_principal_id: Optional[str] = rest_field( - name="userManagedIdentityPrincipalId", visibility=["read", "create", "update", "delete", "query"] - ) - """PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null.""" - user_managed_identity_resource_id: Optional[str] = rest_field( - name="userManagedIdentityResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null.""" - user_managed_identity_tenant_id: Optional[str] = rest_field( - name="userManagedIdentityTenantId", visibility=["read", "create", "update", "delete", "query"] - ) - """TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null.""" - credential_type: Literal[DataReferenceCredentialType.MANAGED_IDENTITY] = rest_discriminator(name="credentialType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. MANAGED_IDENTITY.""" - - @overload - def __init__( - self, - *, - managed_identity_type: Optional[str] = None, - user_managed_identity_client_id: Optional[str] = None, - user_managed_identity_principal_id: Optional[str] = None, - user_managed_identity_resource_id: Optional[str] = None, - user_managed_identity_tenant_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credential_type = DataReferenceCredentialType.MANAGED_IDENTITY # type: ignore - - -class ManagedNetworkProvisionOptions(_Model): - """Managed Network Provisioning options for managed network of a machine learning workspace. - - :ivar include_spark: - :vartype include_spark: bool - """ - - include_spark: Optional[bool] = rest_field( - name="includeSpark", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - include_spark: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedNetworkProvisionStatus(_Model): - """Status of the Provisioning for the managed network of a machine learning workspace. - - :ivar spark_ready: - :vartype spark_ready: bool - :ivar status: Status for the managed network of a machine learning workspace. Known values are: - "Inactive" and "Active". - :vartype status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkStatus - """ - - spark_ready: Optional[bool] = rest_field( - name="sparkReady", visibility=["read", "create", "update", "delete", "query"] - ) - status: Optional[Union[str, "_models.ManagedNetworkStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Status for the managed network of a machine learning workspace. Known values are: \"Inactive\" - and \"Active\".""" - - @overload - def __init__( - self, - *, - spark_ready: Optional[bool] = None, - status: Optional[Union[str, "_models.ManagedNetworkStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedNetworkSettings(_Model): - """Managed Network settings for a machine learning workspace. - - :ivar enable_network_monitor: A flag to indicate if monitoring needs to be enabled for the - managed network. - :vartype enable_network_monitor: bool - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Known values are: "Disabled", "AllowInternetOutbound", and "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of . - :vartype outbound_rules: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus - :ivar firewall_sku: Firewall Sku used for FQDN Rules. Known values are: "Standard" and "Basic". - :vartype firewall_sku: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FirewallSku - :ivar managed_network_kind: The Kind of the managed network. Users can switch from V1 to V2 for - granular access controls, but cannot switch back to V1 once V2 is enabled. Known values are: - "V1" and "V2". - :vartype managed_network_kind: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkKind - :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. - :vartype firewall_public_ip_address: str - """ - - enable_network_monitor: Optional[bool] = rest_field( - name="enableNetworkMonitor", visibility=["read", "create", "update", "delete", "query"] - ) - """A flag to indicate if monitoring needs to be enabled for the managed network.""" - isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = rest_field( - name="isolationMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Isolation mode for the managed network of a machine learning workspace. Known values are: - \"Disabled\", \"AllowInternetOutbound\", and \"AllowOnlyApprovedOutbound\".""" - network_id: Optional[str] = rest_field(name="networkId", visibility=["read"]) - outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = rest_field( - name="outboundRules", visibility=["read", "create", "update", "delete", "query"] - ) - """Dictionary of .""" - status: Optional["_models.ManagedNetworkProvisionStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Status of the Provisioning for the managed network of a machine learning workspace.""" - firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = rest_field( - name="firewallSku", visibility=["read", "create", "update", "delete", "query"] - ) - """Firewall Sku used for FQDN Rules. Known values are: \"Standard\" and \"Basic\".""" - managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = rest_field( - name="managedNetworkKind", visibility=["read", "create", "update", "delete", "query"] - ) - """The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, - but cannot switch back to V1 once V2 is enabled. Known values are: \"V1\" and \"V2\".""" - firewall_public_ip_address: Optional[str] = rest_field(name="firewallPublicIpAddress", visibility=["read"]) - """Public IP address assigned to the Azure Firewall.""" - - @overload - def __init__( - self, - *, - enable_network_monitor: Optional[bool] = None, - isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = None, - outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = None, - status: Optional["_models.ManagedNetworkProvisionStatus"] = None, - firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = None, - managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedNetworkSettingsBasicResource(Resource): - """ManagedNetworkSettingsBasicResource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Managed Network settings for a machine learning workspace. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettings - """ - - properties: Optional["_models.ManagedNetworkSettings"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed Network settings for a machine learning workspace.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ManagedNetworkSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedNetworkSettingsEx(ManagedNetworkSettings): - """ManagedNetworkSettingsEx. - - :ivar enable_network_monitor: A flag to indicate if monitoring needs to be enabled for the - managed network. - :vartype enable_network_monitor: bool - :ivar isolation_mode: Isolation mode for the managed network of a machine learning workspace. - Known values are: "Disabled", "AllowInternetOutbound", and "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of . - :vartype outbound_rules: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a machine learning - workspace. - :vartype status: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus - :ivar firewall_sku: Firewall Sku used for FQDN Rules. Known values are: "Standard" and "Basic". - :vartype firewall_sku: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FirewallSku - :ivar managed_network_kind: The Kind of the managed network. Users can switch from V1 to V2 for - granular access controls, but cannot switch back to V1 once V2 is enabled. Known values are: - "V1" and "V2". - :vartype managed_network_kind: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkKind - :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. - :vartype firewall_public_ip_address: str - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IsolationMode] - """ - - changeable_isolation_modes: Optional[list[Union[str, "_models.IsolationMode"]]] = rest_field( - name="changeableIsolationModes", visibility=["read"] - ) - - @overload - def __init__( - self, - *, - enable_network_monitor: Optional[bool] = None, - isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = None, - outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = None, - status: Optional["_models.ManagedNetworkProvisionStatus"] = None, - firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = None, - managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedNetworkSettingsProperties(_Model): - """The properties of the managed network settings of a machine learning workspace. - - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsEx - :ivar provisioning_state: The current deployment state of the managed network resource. The - provisioningState is to indicate states for resource provisioning. Known values are: - "Deferred", "Updating", "Succeeded", "Failed", "Deleting", and "Deleted". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisioningState - """ - - managed_network: Optional["_models.ManagedNetworkSettingsEx"] = rest_field( - name="managedNetwork", visibility=["read", "create", "update", "delete", "query"] - ) - """Managed Network settings for a machine learning workspace.""" - provisioning_state: Optional[Union[str, "_models.ManagedNetworkProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The current deployment state of the managed network resource. The provisioningState is to - indicate states for resource provisioning. Known values are: \"Deferred\", \"Updating\", - \"Succeeded\", \"Failed\", \"Deleting\", and \"Deleted\".""" - - @overload - def __init__( - self, - *, - managed_network: Optional["_models.ManagedNetworkSettingsEx"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedNetworkSettingsPropertiesBasicResource(ProxyResource): # pylint: disable=name-too-long - """ManagedNetworkSettingsPropertiesBasicResource is a preview-only resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: The properties of the managed network settings of a machine learning - workspace. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsProperties - """ - - properties: Optional["_models.ManagedNetworkSettingsProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the managed network settings of a machine learning workspace.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ManagedNetworkSettingsProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedOnlineDeployment(OnlineDeploymentProperties, discriminator="Managed"): - """Properties specific to a ManagedOnlineDeployment. - - :ivar code_configuration: Code configuration for the endpoint deployment. - :vartype code_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeConfiguration - :ivar description: Description of the endpoint deployment. - :vartype description: str - :ivar environment_id: ARM resource ID or AssetId of the environment specification for the - endpoint deployment. - :vartype environment_id: str - :ivar environment_variables: Environment variables configuration for the deployment. - :vartype environment_variables: dict[str, str] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar app_insights_enabled: If true, enables Application Insights logging. - :vartype app_insights_enabled: bool - :ivar data_collector: The mdc configuration, we disable mdc when it's null. - :vartype data_collector: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataCollector - :ivar egress_public_network_access: Enum to determine whether PublicNetworkAccess is Enabled or - Disabled for egress of a deployment. Known values are: "Enabled" and "Disabled". - :vartype egress_public_network_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EgressPublicNetworkAccessType - :ivar instance_type: Compute instance type. Default: Standard_F4s_v2. - :vartype instance_type: str - :ivar liveness_probe: Liveness probe monitors the health of the container regularly. - :vartype liveness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar model: The URI path to the model. - :vartype model: str - :ivar model_mount_path: The path to mount the model in custom container. - :vartype model_mount_path: str - :ivar provisioning_state: Provisioning state for the endpoint deployment. Known values are: - "Creating", "Deleting", "Scaling", "Updating", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentProvisioningState - :ivar readiness_probe: Readiness probe validates if the container is ready to serve traffic. - The properties and defaults are the same as liveness probe. - :vartype readiness_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar request_settings: Request settings for the deployment. - :vartype request_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineRequestSettings - :ivar scale_settings: Scale settings for the deployment. If it is null or not provided, it - defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment and to - DefaultScaleSettings for ManagedOnlineDeployment. - :vartype scale_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineScaleSettings - :ivar startup_probe: Startup probe verify whether an application within a container has started - successfully. - :vartype startup_probe: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProbeSettings - :ivar endpoint_compute_type: [Required] The compute type of the endpoint. Required. MANAGED. - :vartype endpoint_compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MANAGED - """ - - endpoint_compute_type: Literal[EndpointComputeType.MANAGED] = rest_discriminator(name="endpointComputeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] The compute type of the endpoint. Required. MANAGED.""" - - @overload - def __init__( - self, - *, - code_configuration: Optional["_models.CodeConfiguration"] = None, - description: Optional[str] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, - app_insights_enabled: Optional[bool] = None, - data_collector: Optional["_models.DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "_models.EgressPublicNetworkAccessType"]] = None, - instance_type: Optional[str] = None, - liveness_probe: Optional["_models.ProbeSettings"] = None, - model: Optional[str] = None, - model_mount_path: Optional[str] = None, - readiness_probe: Optional["_models.ProbeSettings"] = None, - request_settings: Optional["_models.OnlineRequestSettings"] = None, - scale_settings: Optional["_models.OnlineScaleSettings"] = None, - startup_probe: Optional["_models.ProbeSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.endpoint_compute_type = EndpointComputeType.MANAGED # type: ignore - - -class ManagedOnlineEndpointDeploymentResourceProperties( - EndpointDeploymentResourceProperties, discriminator="managedOnlineEndpoint" -): # pylint: disable=name-too-long - """ManagedOnlineEndpointDeploymentResourceProperties. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar endpoint_compute_type: Enum to determine endpoint compute type. Known values are: - "Managed", "Kubernetes", and "AzureMLCompute". - :vartype endpoint_compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointComputeType - :ivar model: - :vartype model: str - :ivar type: Kind of the deployment. Required. Default value is "managedOnlineEndpoint". - :vartype type: str - """ - - endpoint_compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = rest_field( - name="endpointComputeType", visibility=["read", "create", "update", "delete", "query"] - ) - """Enum to determine endpoint compute type. Known values are: \"Managed\", \"Kubernetes\", and - \"AzureMLCompute\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal["managedOnlineEndpoint"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Kind of the deployment. Required. Default value is \"managedOnlineEndpoint\".""" - - @overload - def __init__( - self, - *, - failure_reason: Optional[str] = None, - endpoint_compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, - model: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = "managedOnlineEndpoint" # type: ignore - - -class ManagedOnlineEndpointResourceProperties(EndpointResourceProperties, discriminator="managedOnlineEndpoint"): - """ManagedOnlineEndpointResourceProperties. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. Since input dto and when parse endpoint resource - share the same contract this Location field is just for parse the endpoint resource info we - won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Enum to determine endpoint authentication mode. Known values are: "AMLToken", - "Key", and "AADToken". - :vartype auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthMode - :ivar compute: - :vartype compute: str - :ivar description: - :vartype description: str - :ivar mirror_traffic: - :vartype mirror_traffic: dict[str, int] - :ivar scoring_uri: - :vartype scoring_uri: str - :ivar traffic: - :vartype traffic: dict[str, int] - :ivar endpoint_type: Type of the endpoint. Required. MANAGED_ONLINE_ENDPOINT. - :vartype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MANAGED_ONLINE_ENDPOINT - """ - - auth_mode: Optional[Union[str, "_models.EndpointAuthMode"]] = rest_field( - name="authMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Enum to determine endpoint authentication mode. Known values are: \"AMLToken\", \"Key\", and - \"AADToken\".""" - compute: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - mirror_traffic: Optional[dict[str, int]] = rest_field( - name="mirrorTraffic", visibility=["read", "create", "update", "delete", "query"] - ) - scoring_uri: Optional[str] = rest_field( - name="scoringUri", visibility=["read", "create", "update", "delete", "query"] - ) - traffic: Optional[dict[str, int]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - endpoint_type: Literal[EndpointType.MANAGED_ONLINE_ENDPOINT] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of the endpoint. Required. MANAGED_ONLINE_ENDPOINT.""" - - @overload - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[list["_models.EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - auth_mode: Optional[Union[str, "_models.EndpointAuthMode"]] = None, - compute: Optional[str] = None, - description: Optional[str] = None, - mirror_traffic: Optional[dict[str, int]] = None, - scoring_uri: Optional[str] = None, - traffic: Optional[dict[str, int]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.endpoint_type = EndpointType.MANAGED_ONLINE_ENDPOINT # type: ignore - - -class ManagedResourceGroupAssignedIdentities(_Model): - """Details for managed resource group assigned identities. - - :ivar principal_id: Identity principal Id. - :vartype principal_id: str - """ - - principal_id: Optional[str] = rest_field( - name="principalId", visibility=["read", "create", "update", "delete", "query"] - ) - """Identity principal Id.""" - - @overload - def __init__( - self, - *, - principal_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedResourceGroupSettings(_Model): - """Managed resource group settings. - - :ivar assigned_identities: List of assigned identities for the managed resource group. - :vartype assigned_identities: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedResourceGroupAssignedIdentities] - """ - - assigned_identities: Optional[list["_models.ManagedResourceGroupAssignedIdentities"]] = rest_field( - name="assignedIdentities", visibility=["read", "create", "update", "delete", "query"] - ) - """List of assigned identities for the managed resource group.""" - - @overload - def __init__( - self, - *, - assigned_identities: Optional[list["_models.ManagedResourceGroupAssignedIdentities"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ManagedServiceIdentity(_Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The identities assigned to this resource by the user. - :vartype user_assigned_identities: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UserAssignedIdentity] - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of managed identity assigned to this resource. Required. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] - ) - """The identities assigned to this resource by the user.""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MarketplacePlan(_Model): - """MarketplacePlan. - - :ivar offer_id: The identifying name of the Offer of the Marketplace Plan. - :vartype offer_id: str - :ivar plan_id: The identifying name of the Plan of the Marketplace Plan. - :vartype plan_id: str - :ivar publisher_id: The identifying name of the Publisher of the Marketplace Plan. - :vartype publisher_id: str - """ - - offer_id: Optional[str] = rest_field(name="offerId", visibility=["read"]) - """The identifying name of the Offer of the Marketplace Plan.""" - plan_id: Optional[str] = rest_field(name="planId", visibility=["read"]) - """The identifying name of the Plan of the Marketplace Plan.""" - publisher_id: Optional[str] = rest_field(name="publisherId", visibility=["read"]) - """The identifying name of the Publisher of the Marketplace Plan.""" - - -class MarketplaceSubscription(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscriptionProperties - """ - - properties: "_models.MarketplaceSubscriptionProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.MarketplaceSubscriptionProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MarketplaceSubscriptionProperties(_Model): - """MarketplaceSubscriptionProperties. - - :ivar marketplace_plan: Marketplace Plan associated with the Marketplace Subscription. - :vartype marketplace_plan: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplacePlan - :ivar marketplace_subscription_status: Current status of the Marketplace Subscription. Known - values are: "Subscribed", "Suspended", and "Unsubscribed". - :vartype marketplace_subscription_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscriptionStatus - :ivar model_id: [Required] Target Marketplace Model ID to create a Marketplace Subscription - for. Required. - :vartype model_id: str - :ivar provisioning_state: Provisioning State of the Marketplace Subscription. Known values are: - "Creating", "Deleting", "Succeeded", "Failed", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscriptionProvisioningState - """ - - marketplace_plan: Optional["_models.MarketplacePlan"] = rest_field(name="marketplacePlan", visibility=["read"]) - """Marketplace Plan associated with the Marketplace Subscription.""" - marketplace_subscription_status: Optional[Union[str, "_models.MarketplaceSubscriptionStatus"]] = rest_field( - name="marketplaceSubscriptionStatus", visibility=["read"] - ) - """Current status of the Marketplace Subscription. Known values are: \"Subscribed\", - \"Suspended\", and \"Unsubscribed\".""" - model_id: str = rest_field(name="modelId", visibility=["read", "create", "update", "delete", "query"]) - """[Required] Target Marketplace Model ID to create a Marketplace Subscription for. Required.""" - provisioning_state: Optional[Union[str, "_models.MarketplaceSubscriptionProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning State of the Marketplace Subscription. Known values are: \"Creating\", - \"Deleting\", \"Succeeded\", \"Failed\", \"Updating\", and \"Canceled\".""" - - @overload - def __init__( - self, - *, - model_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MaterializationComputeResource(_Model): - """DTO object representing compute resource. - - :ivar instance_type: Specifies the instance type. - :vartype instance_type: str - """ - - instance_type: Optional[str] = rest_field( - name="instanceType", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the instance type.""" - - @overload - def __init__( - self, - *, - instance_type: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MaterializationSettings(_Model): - """MaterializationSettings. - - :ivar notification: Specifies the notification details. - :vartype notification: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar resource: Specifies the compute resource settings. - :vartype resource: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MaterializationComputeResource - :ivar schedule: Specifies the schedule details. - :vartype schedule: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RecurrenceTrigger - :ivar spark_configuration: Specifies the spark compute settings. - :vartype spark_configuration: dict[str, str] - :ivar store_type: Specifies the stores to which materialization should happen. Known values - are: "None", "Online", "Offline", and "OnlineAndOffline". - :vartype store_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MaterializationStoreType - """ - - notification: Optional["_models.NotificationSetting"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the notification details.""" - resource: Optional["_models.MaterializationComputeResource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the compute resource settings.""" - schedule: Optional["_models.RecurrenceTrigger"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the schedule details.""" - spark_configuration: Optional[dict[str, str]] = rest_field( - name="sparkConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the spark compute settings.""" - store_type: Optional[Union[str, "_models.MaterializationStoreType"]] = rest_field( - name="storeType", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the stores to which materialization should happen. Known values are: \"None\", - \"Online\", \"Offline\", and \"OnlineAndOffline\".""" - - @overload - def __init__( - self, - *, - notification: Optional["_models.NotificationSetting"] = None, - resource: Optional["_models.MaterializationComputeResource"] = None, - schedule: Optional["_models.RecurrenceTrigger"] = None, - spark_configuration: Optional[dict[str, str]] = None, - store_type: Optional[Union[str, "_models.MaterializationStoreType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MedianStoppingPolicy(EarlyTerminationPolicy, discriminator="MedianStopping"): - """Defines an early termination policy based on running averages of the primary metric of all - runs. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar policy_type: [Required] Name of policy configuration. Required. MEDIAN_STOPPING. - :vartype policy_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MEDIAN_STOPPING - """ - - policy_type: Literal[EarlyTerminationPolicyType.MEDIAN_STOPPING] = rest_discriminator(name="policyType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Name of policy configuration. Required. MEDIAN_STOPPING.""" - - @overload - def __init__( - self, - *, - delay_evaluation: Optional[int] = None, - evaluation_interval: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.policy_type = EarlyTerminationPolicyType.MEDIAN_STOPPING # type: ignore - - -class MLFlowModelJobInput(JobInput, discriminator="mlflow_model"): - """MLFlowModelJobInput. - - :ivar description: Description for the input. - :vartype description: str - :ivar mode: Enum to determine the input data delivery mode. Known values are: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", and "EvalDownload". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InputDeliveryMode - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar job_input_type: [Required] Specifies the type of job. Required. MLFLOW_MODEL. - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLFLOW_MODEL - """ - - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Enum to determine the input data delivery mode. Known values are: \"ReadOnlyMount\", - \"ReadWriteMount\", \"Download\", \"Direct\", \"EvalMount\", and \"EvalDownload\".""" - uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Input Asset URI. Required.""" - job_input_type: Literal[JobInputType.MLFLOW_MODEL] = rest_discriminator(name="jobInputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. MLFLOW_MODEL.""" - - @overload - def __init__( - self, - *, - uri: str, - description: Optional[str] = None, - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_input_type = JobInputType.MLFLOW_MODEL # type: ignore - - -class MLFlowModelJobOutput(JobOutput, discriminator="mlflow_model"): - """MLFlowModelJobOutput. - - :ivar description: Description for the output. - :vartype description: str - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output data delivery mode enums. Known values are: "ReadWriteMount", "Upload", and - "Direct". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar job_output_type: [Required] Specifies the type of job. Required. MLFLOW_MODEL. - :vartype job_output_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLFLOW_MODEL - """ - - asset_name: Optional[str] = rest_field(name="assetName", visibility=["read", "create", "update", "delete", "query"]) - """Output Asset Name.""" - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Output data delivery mode enums. Known values are: \"ReadWriteMount\", \"Upload\", and - \"Direct\".""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Output Asset URI.""" - job_output_type: Literal[JobOutputType.MLFLOW_MODEL] = rest_discriminator(name="jobOutputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. MLFLOW_MODEL.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_output_type = JobOutputType.MLFLOW_MODEL # type: ignore - - -class MLTableData(DataVersionBaseProperties, discriminator="mltable"): - """MLTable data definition. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_uri: [Required] Uri of the data. Example: - `https://go.microsoft.com/fwlink/?linkid=2202330 - `_. Required. - :vartype data_uri: str - :ivar referenced_uris: Uris referenced in the MLTable definition (required for lineage). - :vartype referenced_uris: list[str] - :ivar data_type: [Required] Specifies the type of data. Required. MLTABLE. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTABLE - """ - - referenced_uris: Optional[list[str]] = rest_field(name="referencedUris", visibility=["read", "create"]) - """Uris referenced in the MLTable definition (required for lineage).""" - data_type: Literal[DataType.MLTABLE] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of data. Required. MLTABLE.""" - - @overload - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - referenced_uris: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = DataType.MLTABLE # type: ignore - - -class MLTableJobInput(JobInput, discriminator="mltable"): - """MLTableJobInput. - - :ivar description: Description for the input. - :vartype description: str - :ivar mode: Enum to determine the input data delivery mode. Known values are: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", and "EvalDownload". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InputDeliveryMode - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar job_input_type: [Required] Specifies the type of job. Required. MLTABLE. - :vartype job_input_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTABLE - """ - - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Enum to determine the input data delivery mode. Known values are: \"ReadOnlyMount\", - \"ReadWriteMount\", \"Download\", \"Direct\", \"EvalMount\", and \"EvalDownload\".""" - uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Input Asset URI. Required.""" - job_input_type: Literal[JobInputType.MLTABLE] = rest_discriminator(name="jobInputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. MLTABLE.""" - - @overload - def __init__( - self, - *, - uri: str, - description: Optional[str] = None, - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_input_type = JobInputType.MLTABLE # type: ignore - - -class MLTableJobOutput(JobOutput, discriminator="mltable"): - """MLTableJobOutput. - - :ivar description: Description for the output. - :vartype description: str - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output data delivery mode enums. Known values are: "ReadWriteMount", "Upload", and - "Direct". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar job_output_type: [Required] Specifies the type of job. Required. MLTABLE. - :vartype job_output_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTABLE - """ - - asset_name: Optional[str] = rest_field(name="assetName", visibility=["read", "create", "update", "delete", "query"]) - """Output Asset Name.""" - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Output data delivery mode enums. Known values are: \"ReadWriteMount\", \"Upload\", and - \"Direct\".""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Output Asset URI.""" - job_output_type: Literal[JobOutputType.MLTABLE] = rest_discriminator(name="jobOutputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. MLTABLE.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_output_type = JobOutputType.MLTABLE # type: ignore - - -class ModelContainer(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainerProperties - """ - - properties: "_models.ModelContainerProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.ModelContainerProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ModelContainerProperties(AssetContainer): - """ModelContainerProperties. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the model container. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - """ - - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the model container. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ModelSettings(_Model): - """ModelSettings. - - :ivar model_id: The unique model identifier that this ServerlessEndpoint should provision. - :vartype model_id: str - """ - - model_id: Optional[str] = rest_field(name="modelId", visibility=["read", "create", "update", "delete", "query"]) - """The unique model identifier that this ServerlessEndpoint should provision.""" - - @overload - def __init__( - self, - *, - model_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ModelVersion(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersionProperties - """ - - properties: "_models.ModelVersionProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.ModelVersionProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ModelVersionProperties(AssetBase): - """Model asset version details. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FlavorData] - :ivar job_name: Name of the training job which produced this model. - :vartype job_name: str - :ivar model_type: The storage format for this entity. Used for NCD. - :vartype model_type: str - :ivar model_uri: The URI path to the model contents. - :vartype model_uri: str - :ivar provisioning_state: Provisioning state for the model version. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssetProvisioningState - :ivar stage: Stage in the model lifecycle assigned to this model. - :vartype stage: str - :ivar datasets: Array of dataset references. - :vartype datasets: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatasetReference] - """ - - flavors: Optional[dict[str, "_models.FlavorData"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Mapping of model flavors to their properties.""" - job_name: Optional[str] = rest_field(name="jobName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the training job which produced this model.""" - model_type: Optional[str] = rest_field(name="modelType", visibility=["read", "create", "update", "delete", "query"]) - """The storage format for this entity. Used for NCD.""" - model_uri: Optional[str] = rest_field(name="modelUri", visibility=["read", "create", "update", "delete", "query"]) - """The URI path to the model contents.""" - provisioning_state: Optional[Union[str, "_models.AssetProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the model version. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - stage: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Stage in the model lifecycle assigned to this model.""" - datasets: Optional[list["_models.DatasetReference"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Array of dataset references.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - flavors: Optional[dict[str, "_models.FlavorData"]] = None, - job_name: Optional[str] = None, - model_type: Optional[str] = None, - model_uri: Optional[str] = None, - stage: Optional[str] = None, - datasets: Optional[list["_models.DatasetReference"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitorComputeConfigurationBase(_Model): - """Monitor compute configuration base definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - MonitorServerlessSparkCompute - - :ivar compute_type: [Required] Specifies the type of signal to monitor. Required. - "ServerlessSpark" - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitorComputeType - """ - - __mapping__: dict[str, _Model] = {} - compute_type: str = rest_discriminator(name="computeType", visibility=["read", "create"]) - """[Required] Specifies the type of signal to monitor. Required. \"ServerlessSpark\"""" - - @overload - def __init__( - self, - *, - compute_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitorDefinition(_Model): - """MonitorDefinition. - - :ivar alert_notification_settings: The monitor's notification settings. - :vartype alert_notification_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitorNotificationSettings - :ivar compute_configuration: [Required] The ARM resource ID of the compute resource to run the - monitoring job on. Required. - :vartype compute_configuration: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitorComputeConfigurationBase - :ivar monitoring_target: The entities targeted by the monitor. - :vartype monitoring_target: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringTarget - :ivar signals: [Required] The signals to monitor. Required. - :vartype signals: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringSignalBase] - """ - - alert_notification_settings: Optional["_models.MonitorNotificationSettings"] = rest_field( - name="alertNotificationSettings", visibility=["read", "create"] - ) - """The monitor's notification settings.""" - compute_configuration: "_models.MonitorComputeConfigurationBase" = rest_field( - name="computeConfiguration", visibility=["read", "create"] - ) - """[Required] The ARM resource ID of the compute resource to run the monitoring job on. Required.""" - monitoring_target: Optional["_models.MonitoringTarget"] = rest_field( - name="monitoringTarget", visibility=["read", "create"] - ) - """The entities targeted by the monitor.""" - signals: dict[str, "_models.MonitoringSignalBase"] = rest_field(visibility=["read", "create"]) - """[Required] The signals to monitor. Required.""" - - @overload - def __init__( - self, - *, - compute_configuration: "_models.MonitorComputeConfigurationBase", - signals: dict[str, "_models.MonitoringSignalBase"], - alert_notification_settings: Optional["_models.MonitorNotificationSettings"] = None, - monitoring_target: Optional["_models.MonitoringTarget"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitorEmailNotificationSettings(_Model): - """MonitorEmailNotificationSettings. - - :ivar emails: The email recipient list which has a limitation of 499 characters in total. - :vartype emails: list[str] - """ - - emails: Optional[list[str]] = rest_field(visibility=["read", "create"]) - """The email recipient list which has a limitation of 499 characters in total.""" - - @overload - def __init__( - self, - *, - emails: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitoringTarget(_Model): - """Monitoring target definition. - - :ivar deployment_id: Reference to the deployment asset targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: Reference to the model asset targeted by this monitor. - :vartype model_id: str - :ivar task_type: [Required] The machine learning task type of the monitored model. Required. - Known values are: "Classification" and "Regression". - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelTaskType - """ - - deployment_id: Optional[str] = rest_field(name="deploymentId", visibility=["read", "create"]) - """Reference to the deployment asset targeted by this monitor.""" - model_id: Optional[str] = rest_field(name="modelId", visibility=["read", "create"]) - """Reference to the model asset targeted by this monitor.""" - task_type: Union[str, "_models.ModelTaskType"] = rest_field(name="taskType", visibility=["read", "create"]) - """[Required] The machine learning task type of the monitored model. Required. Known values are: - \"Classification\" and \"Regression\".""" - - @overload - def __init__( - self, - *, - task_type: Union[str, "_models.ModelTaskType"], - deployment_id: Optional[str] = None, - model_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitoringThreshold(_Model): - """MonitoringThreshold. - - :ivar value: The threshold value. If null, the set default is dependent on the metric type. - :vartype value: float - """ - - value: Optional[float] = rest_field(visibility=["read", "create"]) - """The threshold value. If null, the set default is dependent on the metric type.""" - - @overload - def __init__( - self, - *, - value: Optional[float] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitorNotificationSettings(_Model): - """MonitorNotificationSettings. - - :ivar email_notification_settings: The AML notification email settings. - :vartype email_notification_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitorEmailNotificationSettings - """ - - email_notification_settings: Optional["_models.MonitorEmailNotificationSettings"] = rest_field( - name="emailNotificationSettings", visibility=["read", "create"] - ) - """The AML notification email settings.""" - - @overload - def __init__( - self, - *, - email_notification_settings: Optional["_models.MonitorEmailNotificationSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class MonitorServerlessSparkCompute(MonitorComputeConfigurationBase, discriminator="ServerlessSpark"): - """Monitor serverless spark compute definition. - - :ivar compute_identity: [Required] The identity scheme leveraged to by the spark jobs running - on serverless Spark. Required. - :vartype compute_identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitorComputeIdentityBase - :ivar instance_type: [Required] The instance type running the Spark job. Required. - :vartype instance_type: str - :ivar runtime_version: [Required] The Spark runtime version. Required. - :vartype runtime_version: str - :ivar compute_type: [Required] Specifies the type of signal to monitor. Required. Serverless - Spark compute. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SERVERLESS_SPARK - """ - - compute_identity: "_models.MonitorComputeIdentityBase" = rest_field( - name="computeIdentity", visibility=["read", "create"] - ) - """[Required] The identity scheme leveraged to by the spark jobs running on serverless Spark. - Required.""" - instance_type: str = rest_field(name="instanceType", visibility=["read", "create"]) - """[Required] The instance type running the Spark job. Required.""" - runtime_version: str = rest_field(name="runtimeVersion", visibility=["read", "create"]) - """[Required] The Spark runtime version. Required.""" - compute_type: Literal[MonitorComputeType.SERVERLESS_SPARK] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. Serverless Spark compute.""" - - @overload - def __init__( - self, - *, - compute_identity: "_models.MonitorComputeIdentityBase", - instance_type: str, - runtime_version: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = MonitorComputeType.SERVERLESS_SPARK # type: ignore - - -class Mpi(DistributionConfiguration, discriminator="Mpi"): - """MPI distribution configuration. - - :ivar process_count_per_instance: Number of processes per MPI node. - :vartype process_count_per_instance: int - :ivar distribution_type: [Required] Specifies the type of distribution framework. Required. - MPI. - :vartype distribution_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MPI - """ - - process_count_per_instance: Optional[int] = rest_field( - name="processCountPerInstance", visibility=["read", "create"] - ) - """Number of processes per MPI node.""" - distribution_type: Literal[DistributionType.MPI] = rest_discriminator(name="distributionType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of distribution framework. Required. MPI.""" - - @overload - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.distribution_type = DistributionType.MPI # type: ignore - - -class NetworkAcls(_Model): - """NetworkAcls. - - :ivar default_action: The default action when no rule from ipRules and from virtualNetworkRules - match. This is only used after the bypass property has been evaluated. Known values are: "Deny" - and "Allow". - :vartype default_action: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultActionType - :ivar ip_rules: Rules governing the accessibility of a resource from a specific ip address or - ip range. - :vartype ip_rules: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IPRule] - """ - - default_action: Optional[Union[str, "_models.DefaultActionType"]] = rest_field( - name="defaultAction", visibility=["read", "create", "update", "delete", "query"] - ) - """The default action when no rule from ipRules and from virtualNetworkRules match. This is only - used after the bypass property has been evaluated. Known values are: \"Deny\" and \"Allow\".""" - ip_rules: Optional[list["_models.IPRule"]] = rest_field( - name="ipRules", visibility=["read", "create", "update", "delete", "query"] - ) - """Rules governing the accessibility of a resource from a specific ip address or ip range.""" - - @overload - def __init__( - self, - *, - default_action: Optional[Union[str, "_models.DefaultActionType"]] = None, - ip_rules: Optional[list["_models.IPRule"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NlpVerticalFeaturizationSettings(FeaturizationSettings): - """NlpVerticalFeaturizationSettings. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - """ - - @overload - def __init__( - self, - *, - dataset_language: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NlpVerticalLimitSettings(_Model): - """Job execution constraints. - - :ivar max_concurrent_trials: Maximum Concurrent AutoML iterations. - :vartype max_concurrent_trials: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - """ - - max_concurrent_trials: Optional[int] = rest_field( - name="maxConcurrentTrials", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum Concurrent AutoML iterations.""" - max_trials: Optional[int] = rest_field(name="maxTrials", visibility=["read", "create", "update", "delete", "query"]) - """Number of AutoML iterations.""" - timeout: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """AutoML job timeout.""" - - @overload - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = None, - max_trials: Optional[int] = None, - timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NodeStateCounts(_Model): - """Counts of various compute node states on the amlCompute. - - :ivar idle_node_count: Idle node count. - :vartype idle_node_count: int - :ivar running_node_count: Running node count. - :vartype running_node_count: int - :ivar preparing_node_count: Preparing node count. - :vartype preparing_node_count: int - :ivar unusable_node_count: Unusable node count. - :vartype unusable_node_count: int - :ivar leaving_node_count: Leaving node count. - :vartype leaving_node_count: int - :ivar preempted_node_count: Preempted node count. - :vartype preempted_node_count: int - """ - - idle_node_count: Optional[int] = rest_field(name="idleNodeCount", visibility=["read"]) - """Idle node count.""" - running_node_count: Optional[int] = rest_field(name="runningNodeCount", visibility=["read"]) - """Running node count.""" - preparing_node_count: Optional[int] = rest_field(name="preparingNodeCount", visibility=["read"]) - """Preparing node count.""" - unusable_node_count: Optional[int] = rest_field(name="unusableNodeCount", visibility=["read"]) - """Unusable node count.""" - leaving_node_count: Optional[int] = rest_field(name="leavingNodeCount", visibility=["read"]) - """Leaving node count.""" - preempted_node_count: Optional[int] = rest_field(name="preemptedNodeCount", visibility=["read"]) - """Preempted node count.""" - - -class NoneAuthTypeWorkspaceConnectionProperties( - WorkspaceConnectionPropertiesV2, discriminator="None" -): # pylint: disable=name-too-long - """NoneAuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar auth_type: Authentication type of the connection target. Required. NONE. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NONE - """ - - auth_type: Literal[ConnectionAuthType.NONE] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. NONE.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.NONE # type: ignore - - -class NoneDatastoreCredentials(DatastoreCredentials, discriminator="None"): - """Empty/none datastore credentials. - - :ivar credentials_type: [Required] Credential type used to authentication with storage. - Required. NONE. - :vartype credentials_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NONE - """ - - credentials_type: Literal[CredentialsType.NONE] = rest_discriminator(name="credentialsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. NONE.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credentials_type = CredentialsType.NONE # type: ignore - - -class NotebookAccessTokenResult(_Model): - """NotebookAccessTokenResult. - - :ivar access_token: - :vartype access_token: str - :ivar expires_in: - :vartype expires_in: int - :ivar host_name: - :vartype host_name: str - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar public_dns: - :vartype public_dns: str - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - :ivar token_type: - :vartype token_type: str - """ - - access_token: Optional[str] = rest_field(name="accessToken", visibility=["read"]) - expires_in: Optional[int] = rest_field(name="expiresIn", visibility=["read"]) - host_name: Optional[str] = rest_field(name="hostName", visibility=["read"]) - notebook_resource_id: Optional[str] = rest_field(name="notebookResourceId", visibility=["read"]) - public_dns: Optional[str] = rest_field(name="publicDns", visibility=["read"]) - refresh_token: Optional[str] = rest_field(name="refreshToken", visibility=["read"]) - scope: Optional[str] = rest_field(visibility=["read"]) - token_type: Optional[str] = rest_field(name="tokenType", visibility=["read"]) - - -class NotebookPreparationError(_Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - error_message: Optional[str] = rest_field( - name="errorMessage", visibility=["read", "create", "update", "delete", "query"] - ) - status_code: Optional[int] = rest_field( - name="statusCode", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NotebookResourceInfo(_Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar is_private_link_enabled: - :vartype is_private_link_enabled: bool - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotebookPreparationError - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - """ - - fqdn: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - is_private_link_enabled: Optional[bool] = rest_field( - name="isPrivateLinkEnabled", visibility=["read", "create", "update", "delete", "query"] - ) - notebook_preparation_error: Optional["_models.NotebookPreparationError"] = rest_field( - name="notebookPreparationError", visibility=["read", "create", "update", "delete", "query"] - ) - """The error that occurs when preparing notebook.""" - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """the data plane resourceId that used to initialize notebook component.""" - - @overload - def __init__( - self, - *, - fqdn: Optional[str] = None, - is_private_link_enabled: Optional[bool] = None, - notebook_preparation_error: Optional["_models.NotebookPreparationError"] = None, - resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NotificationSetting(_Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notification type. - :vartype email_on: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EmailNotificationEnableType] - :ivar emails: This is the email recipient list which has a limitation of 499 characters in - total concat with comma separator. - :vartype emails: list[str] - :ivar webhooks: Send webhook callback to a service. Key is a user-provided name for the - webhook. - :vartype webhooks: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Webhook] - """ - - email_on: Optional[list[Union[str, "_models.EmailNotificationEnableType"]]] = rest_field( - name="emailOn", visibility=["read", "create"] - ) - """Send email notification to user on specified notification type.""" - emails: Optional[list[str]] = rest_field(visibility=["read", "create"]) - """This is the email recipient list which has a limitation of 499 characters in total concat with - comma separator.""" - webhooks: Optional[dict[str, "_models.Webhook"]] = rest_field(visibility=["read", "create", "update"]) - """Send webhook callback to a service. Key is a user-provided name for the webhook.""" - - @overload - def __init__( - self, - *, - email_on: Optional[list[Union[str, "_models.EmailNotificationEnableType"]]] = None, - emails: Optional[list[str]] = None, - webhooks: Optional[dict[str, "_models.Webhook"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase, discriminator="Numerical"): - """NumericalDataDriftMetricThreshold. - - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - :ivar metric: [Required] The numerical data drift metric to calculate. Required. Known values - are: "JensenShannonDistance", "PopulationStabilityIndex", "NormalizedWassersteinDistance", and - "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NumericalDataDriftMetric - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Used for - features of numerical data type. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NUMERICAL - """ - - metric: Union[str, "_models.NumericalDataDriftMetric"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The numerical data drift metric to calculate. Required. Known values are: - \"JensenShannonDistance\", \"PopulationStabilityIndex\", \"NormalizedWassersteinDistance\", and - \"TwoSampleKolmogorovSmirnovTest\".""" - data_type: Literal[MonitoringFeatureDataType.NUMERICAL] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the data type of the metric threshold. Required. Used for features of - numerical data type.""" - - @overload - def __init__( - self, - *, - metric: Union[str, "_models.NumericalDataDriftMetric"], - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = MonitoringFeatureDataType.NUMERICAL # type: ignore - - -class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase, discriminator="Numerical"): - """NumericalDataQualityMetricThreshold. - - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - :ivar metric: [Required] The numerical data quality metric to calculate. Required. Known values - are: "NullValueRate", "DataTypeErrorRate", and "OutOfBoundsRate". - :vartype metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NumericalDataQualityMetric - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Used for - features of numerical data type. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NUMERICAL - """ - - metric: Union[str, "_models.NumericalDataQualityMetric"] = rest_field(visibility=["read", "create"]) - """[Required] The numerical data quality metric to calculate. Required. Known values are: - \"NullValueRate\", \"DataTypeErrorRate\", and \"OutOfBoundsRate\".""" - data_type: Literal[MonitoringFeatureDataType.NUMERICAL] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the data type of the metric threshold. Required. Used for features of - numerical data type.""" - - @overload - def __init__( - self, - *, - metric: Union[str, "_models.NumericalDataQualityMetric"], - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = MonitoringFeatureDataType.NUMERICAL # type: ignore - - -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase, discriminator="Numerical"): - """NumericalPredictionDriftMetricThreshold. - - :ivar threshold: The threshold value. If null, a default value will be set depending on the - selected metric. - :vartype threshold: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringThreshold - :ivar metric: [Required] The numerical prediction drift metric to calculate. Required. Known - values are: "JensenShannonDistance", "PopulationStabilityIndex", - "NormalizedWassersteinDistance", and "TwoSampleKolmogorovSmirnovTest". - :vartype metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NumericalPredictionDriftMetric - :ivar data_type: [Required] Specifies the data type of the metric threshold. Required. Used for - features of numerical data type. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NUMERICAL - """ - - metric: Union[str, "_models.NumericalPredictionDriftMetric"] = rest_field(visibility=["read", "create"]) - """[Required] The numerical prediction drift metric to calculate. Required. Known values are: - \"JensenShannonDistance\", \"PopulationStabilityIndex\", \"NormalizedWassersteinDistance\", and - \"TwoSampleKolmogorovSmirnovTest\".""" - data_type: Literal[MonitoringFeatureDataType.NUMERICAL] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the data type of the metric threshold. Required. Used for features of - numerical data type.""" - - @overload - def __init__( - self, - *, - metric: Union[str, "_models.NumericalPredictionDriftMetric"], - threshold: Optional["_models.MonitoringThreshold"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = MonitoringFeatureDataType.NUMERICAL # type: ignore - - -class OAuth2AuthTypeWorkspaceConnectionProperties( - WorkspaceConnectionPropertiesV2, discriminator="OAuth2" -): # pylint: disable=name-too-long - """OAuth2AuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionOAuth2 - :ivar auth_type: Authentication type of the connection target. Required. O_AUTH2. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.O_AUTH2 - """ - - credentials: Optional["_models.WorkspaceConnectionOAuth2"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.O_AUTH2] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. O_AUTH2.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionOAuth2"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.O_AUTH2 # type: ignore - - -class Objective(_Model): - """Optimization objective. - - :ivar goal: [Required] Defines supported metric goals for hyperparameter tuning. Required. - Known values are: "Minimize" and "Maximize". - :vartype goal: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Goal - :ivar primary_metric: [Required] Name of the metric to optimize. Required. - :vartype primary_metric: str - """ - - goal: Union[str, "_models.Goal"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Defines supported metric goals for hyperparameter tuning. Required. Known values - are: \"Minimize\" and \"Maximize\".""" - primary_metric: str = rest_field(name="primaryMetric", visibility=["read", "create", "update", "delete", "query"]) - """[Required] Name of the metric to optimize. Required.""" - - @overload - def __init__( - self, - *, - goal: Union[str, "_models.Goal"], - primary_metric: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OneLakeDatastore(DatastoreProperties, discriminator="OneLake"): - """OneLake (Trident) datastore configuration. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar credentials: [Required] Account credentials. Required. - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreCredentials - :ivar is_default: Readonly property to indicate if datastore is the workspace default - datastore. - :vartype is_default: bool - :ivar artifact: [Required] OneLake artifact backing the datastore. Required. - :vartype artifact: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OneLakeArtifact - :ivar endpoint: OneLake endpoint to use for the datastore. - :vartype endpoint: str - :ivar one_lake_workspace_name: [Required] OneLake workspace name. Required. - :vartype one_lake_workspace_name: str - :ivar service_data_access_auth_identity: Indicates which identity to use to authenticate - service data access to customer's storage. Known values are: "None", - "WorkspaceSystemAssignedIdentity", and "WorkspaceUserAssignedIdentity". - :vartype service_data_access_auth_identity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceDataAccessAuthIdentity - :ivar datastore_type: [Required] Storage type backing the datastore. Required. ONE_LAKE. - :vartype datastore_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ONE_LAKE - """ - - artifact: "_models.OneLakeArtifact" = rest_field(visibility=["read", "create"]) - """[Required] OneLake artifact backing the datastore. Required.""" - endpoint: Optional[str] = rest_field(visibility=["read", "create"]) - """OneLake endpoint to use for the datastore.""" - one_lake_workspace_name: str = rest_field(name="oneLakeWorkspaceName", visibility=["read", "create"]) - """[Required] OneLake workspace name. Required.""" - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = rest_field( - name="serviceDataAccessAuthIdentity", visibility=["read", "create"] - ) - """Indicates which identity to use to authenticate service data access to customer's storage. - Known values are: \"None\", \"WorkspaceSystemAssignedIdentity\", and - \"WorkspaceUserAssignedIdentity\".""" - datastore_type: Literal[DatastoreType.ONE_LAKE] = rest_discriminator(name="datastoreType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Storage type backing the datastore. Required. ONE_LAKE.""" - - @overload - def __init__( - self, - *, - credentials: "_models.DatastoreCredentials", - artifact: "_models.OneLakeArtifact", - one_lake_workspace_name: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "_models.ServiceDataAccessAuthIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.datastore_type = DatastoreType.ONE_LAKE # type: ignore - - -class OnlineDeployment(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeploymentProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.OnlineDeploymentProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.OnlineDeploymentProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OnlineEndpoint(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpointProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.OnlineEndpointProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.OnlineEndpointProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OnlineEndpointProperties(EndpointPropertiesBase): - """Online endpoint configuration. - - :ivar auth_mode: [Required] The authentication method for invoking the endpoint (data plane - operation). Use 'Key' for key-based authentication. Use 'AMLToken' for Azure Machine Learning - token-based authentication. Use 'AADToken' for Microsoft Entra token-based authentication. - Required. Known values are: "AMLToken", "Key", and "AADToken". - :vartype auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthMode - :ivar description: Description of the inference endpoint. - :vartype description: str - :ivar keys_property: EndpointAuthKeys to set initially on an Endpoint. This property will - always be returned as null. AuthKey values must be retrieved using the ListKeys API. - :vartype keys_property: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar scoring_uri: Endpoint URI. - :vartype scoring_uri: str - :ivar swagger_uri: Endpoint Swagger URI. - :vartype swagger_uri: str - :ivar compute: ARM resource ID of the compute if it exists. optional. - :vartype compute: str - :ivar mirror_traffic: Percentage of traffic to be mirrored to each deployment without using - returned scoring. Traffic values need to sum to utmost 50. - :vartype mirror_traffic: dict[str, int] - :ivar provisioning_state: Provisioning state for the endpoint. Known values are: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointProvisioningState - :ivar public_network_access: Enum to determine whether PublicNetworkAccess is Enabled or - Disabled. Known values are: "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PublicNetworkAccessType - :ivar traffic: Percentage of traffic from endpoint to divert to each deployment. Traffic values - need to sum to 100. - :vartype traffic: dict[str, int] - """ - - compute: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """ARM resource ID of the compute if it exists. optional.""" - mirror_traffic: Optional[dict[str, int]] = rest_field( - name="mirrorTraffic", visibility=["read", "create", "update", "delete", "query"] - ) - """Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic - values need to sum to utmost 50.""" - provisioning_state: Optional[Union[str, "_models.EndpointProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the endpoint. Known values are: \"Creating\", \"Deleting\", - \"Succeeded\", \"Failed\", \"Updating\", and \"Canceled\".""" - public_network_access: Optional[Union[str, "_models.PublicNetworkAccessType"]] = rest_field( - name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. Known values are: - \"Enabled\" and \"Disabled\".""" - traffic: Optional[dict[str, int]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to - 100.""" - - @overload - def __init__( - self, - *, - auth_mode: Union[str, "_models.EndpointAuthMode"], - description: Optional[str] = None, - keys_property: Optional["_models.EndpointAuthKeys"] = None, - properties: Optional[dict[str, str]] = None, - compute: Optional[str] = None, - mirror_traffic: Optional[dict[str, int]] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccessType"]] = None, - traffic: Optional[dict[str, int]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OnlineRequestSettings(_Model): - """Online deployment scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar max_queue_wait: (Deprecated for Managed Online Endpoints) The maximum amount of time a - request will stay in the queue in ISO 8601 format. Defaults to 500ms. (Now increase - ``request_timeout_ms`` to account for any networking/queue delays). - :vartype max_queue_wait: ~datetime.timedelta - :ivar request_timeout: The scoring timeout in ISO 8601 format. Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - max_concurrent_requests_per_instance: Optional[int] = rest_field( - name="maxConcurrentRequestsPerInstance", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of maximum concurrent requests per node allowed per deployment. Defaults to 1.""" - max_queue_wait: Optional[datetime.timedelta] = rest_field( - name="maxQueueWait", visibility=["read", "create", "update", "delete", "query"] - ) - """(Deprecated for Managed Online Endpoints) The maximum amount of time a request will stay in the - queue in ISO 8601 format. Defaults to 500ms. (Now increase ``request_timeout_ms`` to account - for any networking/queue delays).""" - request_timeout: Optional[datetime.timedelta] = rest_field( - name="requestTimeout", visibility=["read", "create", "update", "delete", "query"] - ) - """The scoring timeout in ISO 8601 format. Defaults to 5000ms.""" - - @overload - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = None, - max_queue_wait: Optional[datetime.timedelta] = None, - request_timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OpenAIEndpointDeploymentResourceProperties( - EndpointDeploymentResourceProperties, discriminator="Azure.OpenAI" -): # pylint: disable=name-too-long - """OpenAIEndpointDeploymentResourceProperties. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar model: Model used for the endpoint deployment. Required. - :vartype model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Known values are: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", and "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentModelVersionUpgradeOption - :ivar type: Kind of the deployment. Required. Default value is "Azure.OpenAI". - :vartype type: str - """ - - model: "_models.EndpointDeploymentModel" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model used for the endpoint deployment. Required.""" - rai_policy_name: Optional[str] = rest_field( - name="raiPolicyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of RAI policy.""" - sku: Optional["_models.CognitiveServicesSku"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = rest_field( - name="versionUpgradeOption", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment model version upgrade option. Known values are: \"OnceNewDefaultVersionAvailable\", - \"OnceCurrentVersionExpired\", and \"NoAutoUpgrade\".""" - type: Literal["Azure.OpenAI"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Kind of the deployment. Required. Default value is \"Azure.OpenAI\".""" - - @overload - def __init__( - self, - *, - model: "_models.EndpointDeploymentModel", - failure_reason: Optional[str] = None, - rai_policy_name: Optional[str] = None, - sku: Optional["_models.CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = "Azure.OpenAI" # type: ignore - - -class OpenAIEndpointResourceProperties(EndpointResourceProperties, discriminator="Azure.OpenAI"): - """OpenAIEndpointResourceProperties. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. Since input dto and when parse endpoint resource - share the same contract this Location field is just for parse the endpoint resource info we - won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar endpoint_type: Type of the endpoint. Required. AZURE_OPEN_AI. - :vartype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_OPEN_AI - """ - - endpoint_type: Literal[EndpointType.AZURE_OPEN_AI] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of the endpoint. Required. AZURE_OPEN_AI.""" - - @overload - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[list["_models.EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.endpoint_type = EndpointType.AZURE_OPEN_AI # type: ignore - - -class Operation(_Model): - """REST API Operation. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for Azure Resource Manager/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Origin - :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions - that are for internal only APIs. "Internal" - :vartype action_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ActionType - """ - - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - \"Microsoft.Compute/virtualMachines/write\", - \"Microsoft.Compute/virtualMachines/capture/action\".""" - is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) - """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and - \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Localized display information for this particular operation.""" - origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and - \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) - """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for - internal only APIs. \"Internal\"""" - - @overload - def __init__( - self, - *, - display: Optional["_models.OperationDisplay"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OperationDisplay(_Model): - """Localized display information for an operation. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - provider: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring - Insights\" or \"Microsoft Compute\".""" - resource: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly name of the resource type related to this operation. E.g. \"Virtual - Machines\" or \"Job Schedule Collections\".""" - operation: Optional[str] = rest_field(visibility=["read"]) - """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create - or Update Virtual Machine\", \"Restart Virtual Machine\".""" - description: Optional[str] = rest_field(visibility=["read"]) - """The short, localized friendly description of the operation; suitable for tool tips and detailed - views.""" - - -class OsPatchingStatus(_Model): - """Returns metadata about the os patching. - - :ivar patch_status: The os patching status. Known values are: "CompletedWithWarnings", - "Failed", "InProgress", "Succeeded", and "Unknown". - :vartype patch_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PatchStatus - :ivar latest_patch_time: Time of the latest os patching. - :vartype latest_patch_time: str - :ivar reboot_pending: Specifies whether this compute instance is pending for reboot to finish - os patching. - :vartype reboot_pending: bool - :ivar scheduled_reboot_time: Time of scheduled reboot. - :vartype scheduled_reboot_time: str - :ivar os_patching_errors: Collection of errors encountered when doing os patching. - :vartype os_patching_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - """ - - patch_status: Optional[Union[str, "_models.PatchStatus"]] = rest_field( - name="patchStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """The os patching status. Known values are: \"CompletedWithWarnings\", \"Failed\", - \"InProgress\", \"Succeeded\", and \"Unknown\".""" - latest_patch_time: Optional[str] = rest_field( - name="latestPatchTime", visibility=["read", "create", "update", "delete", "query"] - ) - """Time of the latest os patching.""" - reboot_pending: Optional[bool] = rest_field( - name="rebootPending", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies whether this compute instance is pending for reboot to finish os patching.""" - scheduled_reboot_time: Optional[str] = rest_field( - name="scheduledRebootTime", visibility=["read", "create", "update", "delete", "query"] - ) - """Time of scheduled reboot.""" - os_patching_errors: Optional[list["_models.ErrorResponse"]] = rest_field( - name="osPatchingErrors", visibility=["read", "create", "update", "delete", "query"] - ) - """Collection of errors encountered when doing os patching.""" - - @overload - def __init__( - self, - *, - patch_status: Optional[Union[str, "_models.PatchStatus"]] = None, - latest_patch_time: Optional[str] = None, - reboot_pending: Optional[bool] = None, - scheduled_reboot_time: Optional[str] = None, - os_patching_errors: Optional[list["_models.ErrorResponse"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OutboundRuleBasicResource(ProxyResource): - """Concrete proxy resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Outbound Rule for the managed network of a machine learning workspace. - Required. - :vartype properties: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRule - """ - - properties: "_models.OutboundRule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Outbound Rule for the managed network of a machine learning workspace. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.OutboundRule", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OutputPathAssetReference(AssetReferenceBase, discriminator="OutputPath"): - """Reference to an asset via its path in a job output. - - :ivar job_id: ARM resource ID of the job. - :vartype job_id: str - :ivar path: The path of the file/directory in the job output. - :vartype path: str - :ivar reference_type: [Required] Specifies the type of asset reference. Required. OUTPUT_PATH. - :vartype reference_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OUTPUT_PATH - """ - - job_id: Optional[str] = rest_field(name="jobId", visibility=["read", "create", "update", "delete", "query"]) - """ARM resource ID of the job.""" - path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path of the file/directory in the job output.""" - reference_type: Literal[ReferenceType.OUTPUT_PATH] = rest_discriminator(name="referenceType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of asset reference. Required. OUTPUT_PATH.""" - - @overload - def __init__( - self, - *, - job_id: Optional[str] = None, - path: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.reference_type = ReferenceType.OUTPUT_PATH # type: ignore - - -class PackageDetails(_Model): - """PackageDetails. - - :ivar install_path: Install path. - :vartype install_path: str - :ivar installed_version: Installed version. - :vartype installed_version: str - :ivar name: Package or dependency name. - :vartype name: str - :ivar patched_version: Patched version. - :vartype patched_version: str - """ - - install_path: Optional[str] = rest_field( - name="installPath", visibility=["read", "create", "update", "delete", "query"] - ) - """Install path.""" - installed_version: Optional[str] = rest_field( - name="installedVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Installed version.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Package or dependency name.""" - patched_version: Optional[str] = rest_field( - name="patchedVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Patched version.""" - - @overload - def __init__( - self, - *, - install_path: Optional[str] = None, - installed_version: Optional[str] = None, - name: Optional[str] = None, - patched_version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialBatchDeployment(_Model): - """Mutable batch inference settings per deployment. - - :ivar description: Description of the endpoint deployment. - :vartype description: str - """ - - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the endpoint deployment.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(_Model): # pylint: disable=name-too-long - """Strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialBatchDeployment - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - properties: Optional["_models.PartialBatchDeployment"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional attributes of the entity.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.PartialBatchDeployment"] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialManagedServiceIdentity(_Model): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar type: Managed service identity (system assigned and/or user assigned identities). Known - values are: "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, any] - """ - - type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities). Known values are: - \"None\", \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[dict[str, Any]] = rest_field( - name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] - ) - """The set of user assigned identities associated with the resource. The userAssignedIdentities - dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[dict[str, Any]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialMinimalTrackedResource(_Model): - """Strictly used in update requests. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): # pylint: disable=name-too-long - """Strictly used in update requests. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialManagedServiceIdentity - """ - - identity: Optional["_models.PartialManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.PartialManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): - """Strictly used in update requests. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialSku - """ - - sku: Optional["_models.PartialSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.PartialSku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialMinimalTrackedResourceWithSkuAndIdentity(PartialMinimalTrackedResource): # pylint: disable=name-too-long - """Strictly used in update requests. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialSku - """ - - identity: Optional["_models.PartialManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - sku: Optional["_models.PartialSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.PartialManagedServiceIdentity"] = None, - sku: Optional["_models.PartialSku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialRegistryPartialTrackedResource(_Model): - """Strictly used in update requests. - - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegistryPartialManagedServiceIdentity - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialSku - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - identity: Optional["_models.RegistryPartialManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - sku: Optional["_models.PartialSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - - @overload - def __init__( - self, - *, - identity: Optional["_models.RegistryPartialManagedServiceIdentity"] = None, - sku: Optional["_models.PartialSku"] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PartialSku(_Model): - """Common SKU definition. - - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype name: str - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", - "Standard", and "Premium". - :vartype tier: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuTier - """ - - capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in - is not possible for the resource this may be omitted.""" - family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If the service has different generations of hardware, for the same SKU, then that can be - captured here.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the SKU. Ex - P3. It is typically a letter+number code.""" - size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SKU size. When the name field is the combination of tier and some other value, this would - be the standalone code.""" - tier: Optional[Union[str, "_models.SkuTier"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", - and \"Premium\".""" - - @overload - def __init__( - self, - *, - capacity: Optional[int] = None, - family: Optional[str] = None, - name: Optional[str] = None, - size: Optional[str] = None, - tier: Optional[Union[str, "_models.SkuTier"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Password(_Model): - """Password. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - name: Optional[str] = rest_field(visibility=["read"]) - value: Optional[str] = rest_field(visibility=["read"]) - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2, discriminator="PAT"): - """PATAuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPersonalAccessToken - :ivar auth_type: Authentication type of the connection target. Required. PAT. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PAT - """ - - credentials: Optional["_models.WorkspaceConnectionPersonalAccessToken"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.PAT] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. PAT.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionPersonalAccessToken"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.PAT # type: ignore - - -class PendingUploadCredentialDto(_Model): - """PendingUploadCredentialDto. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SASCredentialDto - - :ivar credential_type: [Required] Credential type used to authentication with storage. - Required. "SAS" - :vartype credential_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadCredentialType - """ - - __mapping__: dict[str, _Model] = {} - credential_type: str = rest_discriminator( - name="credentialType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Credential type used to authentication with storage. Required. \"SAS\"""" - - @overload - def __init__( - self, - *, - credential_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PendingUploadRequestDto(_Model): - """PendingUploadRequestDto. - - :ivar pending_upload_id: If PendingUploadId = null then random guid will be used. - :vartype pending_upload_id: str - :ivar pending_upload_type: Type of storage to use for the pending upload location. Known values - are: "None" and "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadType - """ - - pending_upload_id: Optional[str] = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """If PendingUploadId = null then random guid will be used.""" - pending_upload_type: Optional[Union[str, "_models.PendingUploadType"]] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of storage to use for the pending upload location. Known values are: \"None\" and - \"TemporaryBlobReference\".""" - - @overload - def __init__( - self, - *, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "_models.PendingUploadType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PendingUploadResponseDto(_Model): - """PendingUploadResponseDto. - - :ivar blob_reference_for_consumption: Container level read, write, list SAS. - :vartype blob_reference_for_consumption: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BlobReferenceForConsumptionDto - :ivar pending_upload_id: ID for this upload request. - :vartype pending_upload_id: str - :ivar pending_upload_type: Type of storage to use for the pending upload location. Known values - are: "None" and "TemporaryBlobReference". - :vartype pending_upload_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadType - """ - - blob_reference_for_consumption: Optional["_models.BlobReferenceForConsumptionDto"] = rest_field( - name="blobReferenceForConsumption", visibility=["read", "create", "update", "delete", "query"] - ) - """Container level read, write, list SAS.""" - pending_upload_id: Optional[str] = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """ID for this upload request.""" - pending_upload_type: Optional[Union[str, "_models.PendingUploadType"]] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of storage to use for the pending upload location. Known values are: \"None\" and - \"TemporaryBlobReference\".""" - - @overload - def __init__( - self, - *, - blob_reference_for_consumption: Optional["_models.BlobReferenceForConsumptionDto"] = None, - pending_upload_id: Optional[str] = None, - pending_upload_type: Optional[Union[str, "_models.PendingUploadType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PersonalComputeInstanceSettings(_Model): - """Settings for a personal compute instance. - - :ivar assigned_user: Assigned User. - :vartype assigned_user: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AssignedUser - """ - - assigned_user: Optional["_models.AssignedUser"] = rest_field( - name="assignedUser", visibility=["read", "create", "update", "delete", "query"] - ) - """Assigned User.""" - - @overload - def __init__( - self, - *, - assigned_user: Optional["_models.AssignedUser"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PipelineJob(JobBaseProperties, discriminator="Pipeline"): - """Pipeline Job definition: defines generic to MFE attributes. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - :ivar inputs: Inputs for the pipeline job. - :vartype inputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput] - :ivar jobs: Jobs construct the Pipeline Job. - :vartype jobs: dict[str, any] - :ivar outputs: Outputs for the pipeline job. - :vartype outputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutput] - :ivar settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. - :vartype settings: any - :ivar source_job_id: ARM resource ID of source job. - :vartype source_job_id: str - :ivar job_type: [Required] Specifies the type of job. Required. PIPELINE. - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PIPELINE - """ - - inputs: Optional[dict[str, "_models.JobInput"]] = rest_field(visibility=["read", "create"]) - """Inputs for the pipeline job.""" - jobs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create"]) - """Jobs construct the Pipeline Job.""" - outputs: Optional[dict[str, "_models.JobOutput"]] = rest_field(visibility=["read", "create"]) - """Outputs for the pipeline job.""" - settings: Optional[Any] = rest_field(visibility=["read", "create"]) - """Pipeline settings, for things like ContinueRunOnStepFailure etc.""" - source_job_id: Optional[str] = rest_field(name="sourceJobId", visibility=["read", "create"]) - """ARM resource ID of source job.""" - job_type: Literal[JobType.PIPELINE] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. PIPELINE.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - inputs: Optional[dict[str, "_models.JobInput"]] = None, - jobs: Optional[dict[str, Any]] = None, - outputs: Optional[dict[str, "_models.JobOutput"]] = None, - settings: Optional[Any] = None, - source_job_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = JobType.PIPELINE # type: ignore - - -class PredictionDriftMonitoringSignal(MonitoringSignalBase, discriminator="PredictionDrift"): - """PredictionDriftMonitoringSignal. - - :ivar notification_types: The current notification mode for this signal. - :vartype notification_types: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringNotificationType] - :ivar properties: Property dictionary. Properties can be added, but not removed or altered. - :vartype properties: dict[str, str] - :ivar feature_data_type_override: A dictionary that maps feature names to their respective data - types. - :vartype feature_data_type_override: dict[str, str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringFeatureDataType] - :ivar metric_thresholds: [Required] A list of metrics to calculate and their associated - thresholds. Required. - :vartype metric_thresholds: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PredictionDriftMetricThresholdBase] - :ivar production_data: [Required] The data which drift will be calculated for. Required. - :vartype production_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase - :ivar reference_data: [Required] The data to calculate drift against. Required. - :vartype reference_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MonitoringInputDataBase - :ivar signal_type: [Required] Specifies the type of signal to monitor. Required. Tracks - prediction result data distribution change, comparing against validation/test label data or - past production data. - :vartype signal_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PREDICTION_DRIFT - """ - - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = rest_field( - name="featureDataTypeOverride", visibility=["read", "create"] - ) - """A dictionary that maps feature names to their respective data types.""" - metric_thresholds: list["_models.PredictionDriftMetricThresholdBase"] = rest_field( - name="metricThresholds", visibility=["read", "create"] - ) - """[Required] A list of metrics to calculate and their associated thresholds. Required.""" - production_data: "_models.MonitoringInputDataBase" = rest_field( - name="productionData", visibility=["read", "create"] - ) - """[Required] The data which drift will be calculated for. Required.""" - reference_data: "_models.MonitoringInputDataBase" = rest_field(name="referenceData", visibility=["read", "create"]) - """[Required] The data to calculate drift against. Required.""" - signal_type: Literal[MonitoringSignalType.PREDICTION_DRIFT] = rest_discriminator(name="signalType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. Tracks prediction result data - distribution change, comparing against validation/test label data or past production data.""" - - @overload - def __init__( - self, - *, - metric_thresholds: list["_models.PredictionDriftMetricThresholdBase"], - production_data: "_models.MonitoringInputDataBase", - reference_data: "_models.MonitoringInputDataBase", - notification_types: Optional[list[Union[str, "_models.MonitoringNotificationType"]]] = None, - properties: Optional[dict[str, str]] = None, - feature_data_type_override: Optional[dict[str, Union[str, "_models.MonitoringFeatureDataType"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.signal_type = MonitoringSignalType.PREDICTION_DRIFT # type: ignore - - -class PrivateEndpoint(_Model): - """The private endpoint resource. - - :ivar id: The resource identifier of the private endpoint. - :vartype id: str - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """The resource identifier of the private endpoint.""" - - -class PrivateEndpointConnection(ProxyResource): - """The Private Endpoint Connection resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Private endpoint connection properties. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnectionProperties - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - :ivar location: *Same as workspace location. - :vartype location: str - :ivar tags: - :vartype tags: dict[str, str] - """ - - properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Private endpoint connection properties.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional. This field is required to be implemented by the RP because AML is supporting more - than one tier.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """*Same as workspace location.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - __flattened_items = ["private_endpoint", "private_link_service_connection_state", "provisioning_state"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - sku: Optional["_models.Sku"] = None, - location: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class PrivateEndpointConnectionProperties(_Model): - """Private endpoint connection properties. - - :ivar private_endpoint: - :vartype private_endpoint: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspacePrivateEndpointResource - :ivar private_link_service_connection_state: The connection state. - :vartype private_link_service_connection_state: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The current provisioning state. Known values are: "Succeeded", - "Creating", "Deleting", and "Failed". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnectionProvisioningState - """ - - private_endpoint: Optional["_models.WorkspacePrivateEndpointResource"] = rest_field( - name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] - ) - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = rest_field( - name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] - ) - """The connection state.""" - provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The current provisioning state. Known values are: \"Succeeded\", \"Creating\", \"Deleting\", - and \"Failed\".""" - - @overload - def __init__( - self, - *, - private_endpoint: Optional["_models.WorkspacePrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PrivateEndpointDestination(_Model): - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a - machine learning workspace. - - :ivar service_resource_id: - :vartype service_resource_id: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Type of a managed network Outbound Rule of a machine learning workspace. - Known values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype spark_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleStatus - :ivar subresource_target: - :vartype subresource_target: str - """ - - service_resource_id: Optional[str] = rest_field( - name="serviceResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - spark_enabled: Optional[bool] = rest_field( - name="sparkEnabled", visibility=["read", "create", "update", "delete", "query"] - ) - spark_status: Optional[Union[str, "_models.RuleStatus"]] = rest_field( - name="sparkStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of a managed network Outbound Rule of a machine learning workspace. Known values are: - \"Inactive\", \"Active\", \"Provisioning\", \"Deleting\", and \"Failed\".""" - subresource_target: Optional[str] = rest_field( - name="subresourceTarget", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "_models.RuleStatus"]] = None, - subresource_target: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PrivateEndpointOutboundRule(OutboundRule, discriminator="PrivateEndpoint"): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Known values are: "Required", "Recommended", "UserDefined", and "Dependency". - :vartype category: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Known - values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleStatus - :ivar error_information: Error information about an outbound rule of a machine learning - workspace if RuleStatus is failed. - :vartype error_information: str - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar destination: Private Endpoint destination for a Private Endpoint Outbound Rule for the - managed network of a machine learning workspace. - :vartype destination: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointDestination - :ivar fqdns: - :vartype fqdns: list[str] - :ivar type: Type of a managed network Outbound Rule of a machine learning workspace. Required. - PRIVATE_ENDPOINT. - :vartype type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PRIVATE_ENDPOINT - """ - - destination: Optional["_models.PrivateEndpointDestination"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a - machine learning workspace.""" - fqdns: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[RuleType.PRIVATE_ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of a managed network Outbound Rule of a machine learning workspace. Required. - PRIVATE_ENDPOINT.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.RuleCategory"]] = None, - status: Optional[Union[str, "_models.RuleStatus"]] = None, - destination: Optional["_models.PrivateEndpointDestination"] = None, - fqdns: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = RuleType.PRIVATE_ENDPOINT # type: ignore - - -class PrivateEndpointResource(PrivateEndpoint): - """The PE network resource that is linked to this PE connection. - - :ivar id: The resource identifier of the private endpoint. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - subnet_arm_id: Optional[str] = rest_field( - name="subnetArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """The subnetId that the private endpoint is connected to.""" - - @overload - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PrivateLinkResource(Resource): - """A private link resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar identity: - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar location: Same as workspace location. - :vartype location: str - :ivar properties: Properties of a private link resource. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateLinkResourceProperties - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - :ivar tags: - :vartype tags: dict[str, str] - """ - - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Same as workspace location.""" - properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of a private link resource.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional. This field is required to be implemented by the RP because AML is supporting more - than one tier.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - __flattened_items = ["group_id", "required_members", "required_zone_names"] - - @overload - def __init__( - self, - *, - identity: Optional["_models.ManagedServiceIdentity"] = None, - location: Optional[str] = None, - properties: Optional["_models.PrivateLinkResourceProperties"] = None, - sku: Optional["_models.Sku"] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class PrivateLinkResourceProperties(_Model): - """Properties of a private link resource. - - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - group_id: Optional[str] = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """The private link resource group id.""" - required_members: Optional[list[str]] = rest_field( - name="requiredMembers", visibility=["read", "create", "update", "delete", "query"] - ) - """The private link resource required member names.""" - required_zone_names: Optional[list[str]] = rest_field( - name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"] - ) - """The private link resource Private link DNS zone name.""" - - @overload - def __init__( - self, - *, - group_id: Optional[str] = None, - required_members: Optional[list[str]] = None, - required_zone_names: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PrivateLinkServiceConnectionState(_Model): - """A collection of information about the state of the connection between service consumer and - provider. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider\\r\\nPossible - state transitions\\r\\nPending -> Approved (Service provider approves the connection - request)\\r\\nPending -> Rejected (Service provider rejects the connection - request)\\r\\nPending -> Disconnected (Service provider deletes the connection)\\r\\nApproved - -> Rejected (Service provider rejects the approved connection)\\r\\nApproved -> Disconnected - (Service provider deletes the connection)\\r\\nRejected -> Pending (Service consumer - re-initiates the connection request that was rejected)\\r\\nRejected -> Disconnected (Service - provider deletes the connection). Known values are: "Approved", "Pending", "Rejected", - "Disconnected", and "Timeout". - :vartype status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointServiceConnectionStatus - """ - - actions_required: Optional[str] = rest_field( - name="actionsRequired", visibility=["read", "create", "update", "delete", "query"] - ) - """Some RP chose \"None\". Other RPs use this for region expansion.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """User-defined message that, per NRP doc, may be used for approval-related message.""" - status: Optional[Union[str, "_models.EndpointServiceConnectionStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Connection status of the service consumer with the service provider\r\nPossible state - transitions\r\nPending -> Approved (Service provider approves the connection - request)\r\nPending -> Rejected (Service provider rejects the connection request)\r\nPending -> - Disconnected (Service provider deletes the connection)\r\nApproved -> Rejected (Service - provider rejects the approved connection)\r\nApproved -> Disconnected (Service provider deletes - the connection)\r\nRejected -> Pending (Service consumer re-initiates the connection request - that was rejected)\r\nRejected -> Disconnected (Service provider deletes the connection). Known - values are: \"Approved\", \"Pending\", \"Rejected\", \"Disconnected\", and \"Timeout\".""" - - @overload - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "_models.EndpointServiceConnectionStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ProbeSettings(_Model): - """Deployment container liveness/readiness probe configuration. - - :ivar failure_threshold: The number of failures to allow before returning an unhealthy status. - :vartype failure_threshold: int - :ivar initial_delay: The delay before the first probe in ISO 8601 format. - :vartype initial_delay: ~datetime.timedelta - :ivar period: The length of time between probes in ISO 8601 format. - :vartype period: ~datetime.timedelta - :ivar success_threshold: The number of successful probes before returning a healthy status. - :vartype success_threshold: int - :ivar timeout: The probe timeout in ISO 8601 format. - :vartype timeout: ~datetime.timedelta - """ - - failure_threshold: Optional[int] = rest_field( - name="failureThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of failures to allow before returning an unhealthy status.""" - initial_delay: Optional[datetime.timedelta] = rest_field( - name="initialDelay", visibility=["read", "create", "update", "delete", "query"] - ) - """The delay before the first probe in ISO 8601 format.""" - period: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The length of time between probes in ISO 8601 format.""" - success_threshold: Optional[int] = rest_field( - name="successThreshold", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of successful probes before returning a healthy status.""" - timeout: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The probe timeout in ISO 8601 format.""" - - @overload - def __init__( - self, - *, - failure_threshold: Optional[int] = None, - initial_delay: Optional[datetime.timedelta] = None, - period: Optional[datetime.timedelta] = None, - success_threshold: Optional[int] = None, - timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PromptSettings(_Model): - """PromptSettings. - - :ivar enable_chain_of_density: - :vartype enable_chain_of_density: bool - :ivar enable_chain_of_thought: - :vartype enable_chain_of_thought: bool - :ivar max_len_summary: - :vartype max_len_summary: int - """ - - enable_chain_of_density: Optional[bool] = rest_field( - name="enableChainOfDensity", visibility=["read", "create", "update", "delete", "query"] - ) - enable_chain_of_thought: Optional[bool] = rest_field( - name="enableChainOfThought", visibility=["read", "create", "update", "delete", "query"] - ) - max_len_summary: Optional[int] = rest_field( - name="maxLenSummary", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - enable_chain_of_density: Optional[bool] = None, - enable_chain_of_thought: Optional[bool] = None, - max_len_summary: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PTUDeploymentUsage(_Model): - """PTUDeploymentUsage. - - :ivar collection_quota_usage: Usage number from the collection level quota. - :vartype collection_quota_usage: int - :ivar deployment_name: Deployment name. - :vartype deployment_name: str - :ivar resource_group: Resource group name. - :vartype resource_group: str - :ivar usage: Usage number from subscription level quota. - :vartype usage: int - :ivar workspace_name: Workspace name. - :vartype workspace_name: str - """ - - collection_quota_usage: Optional[int] = rest_field( - name="collectionQuotaUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """Usage number from the collection level quota.""" - deployment_name: Optional[str] = rest_field( - name="deploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment name.""" - resource_group: Optional[str] = rest_field( - name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """Resource group name.""" - usage: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage number from subscription level quota.""" - workspace_name: Optional[str] = rest_field( - name="workspaceName", visibility=["read", "create", "update", "delete", "query"] - ) - """Workspace name.""" - - @overload - def __init__( - self, - *, - collection_quota_usage: Optional[int] = None, - deployment_name: Optional[str] = None, - resource_group: Optional[str] = None, - usage: Optional[int] = None, - workspace_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PyTorch(DistributionConfiguration, discriminator="PyTorch"): - """PyTorch distribution configuration. - - :ivar process_count_per_instance: Number of processes per node. - :vartype process_count_per_instance: int - :ivar distribution_type: [Required] Specifies the type of distribution framework. Required. - PY_TORCH. - :vartype distribution_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PY_TORCH - """ - - process_count_per_instance: Optional[int] = rest_field( - name="processCountPerInstance", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of processes per node.""" - distribution_type: Literal[DistributionType.PY_TORCH] = rest_discriminator(name="distributionType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of distribution framework. Required. PY_TORCH.""" - - @overload - def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.distribution_type = DistributionType.PY_TORCH # type: ignore - - -class QueueSettings(_Model): - """QueueSettings. - - :ivar job_tier: Enum to determine the job tier. Known values are: "Null", "Spot", "Basic", - "Standard", and "Premium". - :vartype job_tier: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobTier - """ - - job_tier: Optional[Union[str, "_models.JobTier"]] = rest_field(name="jobTier", visibility=["read", "create"]) - """Enum to determine the job tier. Known values are: \"Null\", \"Spot\", \"Basic\", \"Standard\", - and \"Premium\".""" - - @overload - def __init__( - self, - *, - job_tier: Optional[Union[str, "_models.JobTier"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class QuotaBaseProperties(_Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: Limit. - :vartype limit: int - :ivar unit: An enum describing the unit of quota measurement. "Count" - :vartype unit: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaUnit - """ - - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the resource ID.""" - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the resource type.""" - limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Limit.""" - unit: Optional[Union[str, "_models.QuotaUnit"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """An enum describing the unit of quota measurement. \"Count\"""" - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "_models.QuotaUnit"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class QuotaUpdateParameters(_Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - value: Optional[list["_models.QuotaBaseProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list for update quota.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Region of workspace quota to be updated.""" - - @overload - def __init__( - self, - *, - value: Optional[list["_models.QuotaBaseProperties"]] = None, - location: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiBlocklistConfig(_Model): - """Azure OpenAI blocklist config. - - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - """ - - blocking: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If blocking would occur.""" - blocklist_name: Optional[str] = rest_field( - name="blocklistName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of ContentFilter.""" - - @overload - def __init__( - self, - *, - blocking: Optional[bool] = None, - blocklist_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiBlocklistItemBulkRequest(_Model): - """The Cognitive Services RaiBlocklist Item request body. - - :ivar name: - :vartype name: str - :ivar properties: Properties of Cognitive Services RaiBlocklist Item. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemProperties - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - properties: Optional["_models.RaiBlocklistItemProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of Cognitive Services RaiBlocklist Item.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - properties: Optional["_models.RaiBlocklistItemProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiBlocklistItemProperties(_Model): - """RAI Custom Blocklist Item properties. - - :ivar is_regex: If the pattern is a regex pattern. - :vartype is_regex: bool - :ivar pattern: Pattern to match against. - :vartype pattern: str - """ - - is_regex: Optional[bool] = rest_field(name="isRegex", visibility=["read", "create", "update", "delete", "query"]) - """If the pattern is a regex pattern.""" - pattern: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pattern to match against.""" - - @overload - def __init__( - self, - *, - is_regex: Optional[bool] = None, - pattern: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiBlocklistItemPropertiesBasicResource(ProxyResource): - """RaiBlocklistItemPropertiesBasicResource is a preview-only resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: RAI Custom Blocklist Item properties. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemProperties - """ - - properties: "_models.RaiBlocklistItemProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """RAI Custom Blocklist Item properties. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.RaiBlocklistItemProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiBlocklistProperties(_Model): - """RAI Custom Blocklist properties. - - :ivar description: Description of the block list. - :vartype description: str - """ - - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the block list.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiBlocklistPropertiesBasicResource(ProxyResource): - """RaiBlocklistPropertiesBasicResource is a preview-only resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: RAI Custom Blocklist properties. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistProperties - """ - - properties: "_models.RaiBlocklistProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """RAI Custom Blocklist properties. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.RaiBlocklistProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiPolicyContentFilter(_Model): - """Azure OpenAI Content Filter. - - :ivar allowed_content_level: Level at which content is filtered. Known values are: "Low", - "Medium", and "High". - :vartype allowed_content_level: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AllowedContentLevel - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar enabled: If the ContentFilter is enabled. - :vartype enabled: bool - :ivar name: Name of ContentFilter. - :vartype name: str - :ivar source: Content source to apply the Content Filters. Known values are: "Prompt" and - "Completion". - :vartype source: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyContentSource - """ - - allowed_content_level: Optional[Union[str, "_models.AllowedContentLevel"]] = rest_field( - name="allowedContentLevel", visibility=["read", "create", "update", "delete", "query"] - ) - """Level at which content is filtered. Known values are: \"Low\", \"Medium\", and \"High\".""" - blocking: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If blocking would occur.""" - enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If the ContentFilter is enabled.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of ContentFilter.""" - source: Optional[Union[str, "_models.RaiPolicyContentSource"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Content source to apply the Content Filters. Known values are: \"Prompt\" and \"Completion\".""" - - @overload - def __init__( - self, - *, - allowed_content_level: Optional[Union[str, "_models.AllowedContentLevel"]] = None, - blocking: Optional[bool] = None, - enabled: Optional[bool] = None, - name: Optional[str] = None, - source: Optional[Union[str, "_models.RaiPolicyContentSource"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiPolicyProperties(_Model): - """Azure OpenAI Content Filters properties. - - :ivar base_policy_name: Name of the base Content Filters. - :vartype base_policy_name: str - :ivar completion_blocklists: - :vartype completion_blocklists: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistConfig] - :ivar content_filters: - :vartype content_filters: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyContentFilter] - :ivar mode: Content Filters mode. Known values are: "Default", "Deferred", and "Blocking". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyMode - :ivar prompt_blocklists: - :vartype prompt_blocklists: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistConfig] - :ivar type: Content Filters policy type. Known values are: "UserManaged" and "SystemManaged". - :vartype type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyType - """ - - base_policy_name: Optional[str] = rest_field( - name="basePolicyName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the base Content Filters.""" - completion_blocklists: Optional[list["_models.RaiBlocklistConfig"]] = rest_field( - name="completionBlocklists", visibility=["read", "create", "update", "delete", "query"] - ) - content_filters: Optional[list["_models.RaiPolicyContentFilter"]] = rest_field( - name="contentFilters", visibility=["read", "create", "update", "delete", "query"] - ) - mode: Optional[Union[str, "_models.RaiPolicyMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Content Filters mode. Known values are: \"Default\", \"Deferred\", and \"Blocking\".""" - prompt_blocklists: Optional[list["_models.RaiBlocklistConfig"]] = rest_field( - name="promptBlocklists", visibility=["read", "create", "update", "delete", "query"] - ) - type: Optional[Union[str, "_models.RaiPolicyType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Content Filters policy type. Known values are: \"UserManaged\" and \"SystemManaged\".""" - - @overload - def __init__( - self, - *, - base_policy_name: Optional[str] = None, - completion_blocklists: Optional[list["_models.RaiBlocklistConfig"]] = None, - content_filters: Optional[list["_models.RaiPolicyContentFilter"]] = None, - mode: Optional[Union[str, "_models.RaiPolicyMode"]] = None, - prompt_blocklists: Optional[list["_models.RaiBlocklistConfig"]] = None, - type: Optional[Union[str, "_models.RaiPolicyType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RaiPolicyPropertiesBasicResource(ProxyResource): - """Azure OpenAI Content Filters resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Azure OpenAI Content Filters properties. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyProperties - """ - - properties: "_models.RaiPolicyProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Azure OpenAI Content Filters properties. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.RaiPolicyProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RandomSamplingAlgorithm(SamplingAlgorithm, discriminator="Random"): - """Defines a Sampling Algorithm that generates values randomly. - - :ivar rule: The specific type of random algorithm. Known values are: "Random" and "Sobol". - :vartype rule: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RandomSamplingAlgorithmRule - :ivar seed: An optional integer to use as the seed for random number generation. - :vartype seed: int - :ivar sampling_algorithm_type: [Required] The algorithm used for generating hyperparameter - values, along with configuration properties. Required. RANDOM. - :vartype sampling_algorithm_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RANDOM - """ - - rule: Optional[Union[str, "_models.RandomSamplingAlgorithmRule"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The specific type of random algorithm. Known values are: \"Random\" and \"Sobol\".""" - seed: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional integer to use as the seed for random number generation.""" - sampling_algorithm_type: Literal[SamplingAlgorithmType.RANDOM] = rest_discriminator(name="samplingAlgorithmType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] The algorithm used for generating hyperparameter values, along with configuration - properties. Required. RANDOM.""" - - @overload - def __init__( - self, - *, - rule: Optional[Union[str, "_models.RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.sampling_algorithm_type = SamplingAlgorithmType.RANDOM # type: ignore - - -class Recurrence(_Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: [Required] The frequency to trigger schedule. Known values are: "Minute", - "Hour", "Day", "Week", and "Month". - :vartype frequency: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeRecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. - :vartype interval: int - :ivar start_time: The start time in yyyy-MM-ddTHH:mm:ss format. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows - time zone format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_. - :vartype time_zone: str - :ivar schedule: [Required] The recurrence schedule. - :vartype schedule: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeRecurrenceSchedule - """ - - frequency: Optional[Union[str, "_models.ComputeRecurrenceFrequency"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The frequency to trigger schedule. Known values are: \"Minute\", \"Hour\", \"Day\", - \"Week\", and \"Month\".""" - interval: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Specifies schedule interval in conjunction with frequency.""" - start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) - """The start time in yyyy-MM-ddTHH:mm:ss format.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone - format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_.""" - schedule: Optional["_models.ComputeRecurrenceSchedule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The recurrence schedule.""" - - @overload - def __init__( - self, - *, - frequency: Optional[Union[str, "_models.ComputeRecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = None, - schedule: Optional["_models.ComputeRecurrenceSchedule"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RecurrenceSchedule(_Model): - """RecurrenceSchedule. - - :ivar hours: [Required] List of hours for the schedule. Required. - :vartype hours: list[int] - :ivar minutes: [Required] List of minutes for the schedule. Required. - :vartype minutes: list[int] - :ivar month_days: List of month days for the schedule. - :vartype month_days: list[int] - :ivar week_days: List of days for the schedule. - :vartype week_days: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WeekDay] - """ - - hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] List of hours for the schedule. Required.""" - minutes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] List of minutes for the schedule. Required.""" - month_days: Optional[list[int]] = rest_field( - name="monthDays", visibility=["read", "create", "update", "delete", "query"] - ) - """List of month days for the schedule.""" - week_days: Optional[list[Union[str, "_models.WeekDay"]]] = rest_field( - name="weekDays", visibility=["read", "create", "update", "delete", "query"] - ) - """List of days for the schedule.""" - - @overload - def __init__( - self, - *, - hours: list[int], - minutes: list[int], - month_days: Optional[list[int]] = None, - week_days: Optional[list[Union[str, "_models.WeekDay"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RecurrenceTrigger(TriggerBase, discriminator="Recurrence"): - """RecurrenceTrigger. - - :ivar end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - `https://en.wikipedia.org/wiki/ISO_8601 `_. Recommented - format would be "2022-06-01T00:00:01" If not present, the schedule will run indefinitely. - :vartype end_time: str - :ivar start_time: Specifies start time of schedule in ISO 8601 format, but without a UTC - offset. - :vartype start_time: str - :ivar time_zone: Specifies time zone in which the schedule runs. TimeZone should follow Windows - time zone format. Refer: - `https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 - `_. - :vartype time_zone: str - :ivar frequency: [Required] The frequency to trigger schedule. Required. Known values are: - "Minute", "Hour", "Day", "Week", and "Month". - :vartype frequency: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RecurrenceFrequency - :ivar interval: [Required] Specifies schedule interval in conjunction with frequency. Required. - :vartype interval: int - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RecurrenceSchedule - :ivar trigger_type: [Required]. Required. RECURRENCE. - :vartype trigger_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RECURRENCE - """ - - frequency: Union[str, "_models.RecurrenceFrequency"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The frequency to trigger schedule. Required. Known values are: \"Minute\", \"Hour\", - \"Day\", \"Week\", and \"Month\".""" - interval: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Specifies schedule interval in conjunction with frequency. Required.""" - schedule: Optional["_models.RecurrenceSchedule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The recurrence schedule.""" - trigger_type: Literal[TriggerType.RECURRENCE] = rest_discriminator(name="triggerType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required]. Required. RECURRENCE.""" - - @overload - def __init__( - self, - *, - frequency: Union[str, "_models.RecurrenceFrequency"], - interval: int, - end_time: Optional[str] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = None, - schedule: Optional["_models.RecurrenceSchedule"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.trigger_type = TriggerType.RECURRENCE # type: ignore - - -class RegenerateEndpointKeysRequest(_Model): - """RegenerateEndpointKeysRequest. - - :ivar key_type: [Required] Specification for which type of key to generate. Primary or - Secondary. Required. Known values are: "Primary" and "Secondary". - :vartype key_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.KeyType - :ivar key_value: The value the key is set to. - :vartype key_value: str - """ - - key_type: Union[str, "_models.KeyType"] = rest_field( - name="keyType", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Specification for which type of key to generate. Primary or Secondary. Required. - Known values are: \"Primary\" and \"Secondary\".""" - key_value: Optional[str] = rest_field(name="keyValue", visibility=["read", "create", "update", "delete", "query"]) - """The value the key is set to.""" - - @overload - def __init__( - self, - *, - key_type: Union[str, "_models.KeyType"], - key_value: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RegenerateServiceAccountKeyContent(_Model): - """RegenerateServiceAccountKeyContent. - - :ivar key_name: Known values are: "Key1" and "Key2". - :vartype key_name: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceAccountKeyName - """ - - key_name: Optional[Union[str, "_models.ServiceAccountKeyName"]] = rest_field( - name="keyName", visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"Key1\" and \"Key2\".""" - - @overload - def __init__( - self, - *, - key_name: Optional[Union[str, "_models.ServiceAccountKeyName"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Registry(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegistryProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.RegistryProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - __flattened_items = [ - "discovery_url", - "intellectual_property_publisher", - "managed_resource_group", - "managed_resource_group_settings", - "ml_flow_registry_uri", - "registry_private_endpoint_connections", - "public_network_access", - "region_details", - ] - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.RegistryProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class RegistryListCredentialsResult(_Model): - """RegistryListCredentialsResult. - - :ivar location: The location of the workspace ACR. - :vartype location: str - :ivar passwords: - :vartype passwords: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Password] - :ivar username: The username of the workspace ACR. - :vartype username: str - """ - - location: Optional[str] = rest_field(visibility=["read"]) - """The location of the workspace ACR.""" - passwords: Optional[list["_models.Password"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - username: Optional[str] = rest_field(visibility=["read"]) - """The username of the workspace ACR.""" - - @overload - def __init__( - self, - *, - passwords: Optional[list["_models.Password"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RegistryPartialManagedServiceIdentity(ManagedServiceIdentity): - """Managed service identity (system assigned and/or user assigned identities). - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The identities assigned to this resource by the user. - :vartype user_assigned_identities: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UserAssignedIdentity] - """ - - @overload - def __init__( - self, - *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RegistryPrivateEndpointConnection(_Model): - """Private endpoint connection definition. - - :ivar id: This is the private endpoint connection name created on SRP Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. - :vartype id: str - :ivar location: Same as workspace location. - :vartype location: str - :ivar properties: Properties of the Private Endpoint Connection. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegistryPrivateEndpointConnectionProperties - """ - - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """This is the private endpoint connection name created on SRP Full resource id: - /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}.""" - location: Optional[str] = rest_field(visibility=["read", "create"]) - """Same as workspace location.""" - properties: Optional["_models.RegistryPrivateEndpointConnectionProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of the Private Endpoint Connection.""" - - __flattened_items = [ - "group_ids", - "private_endpoint", - "registry_private_link_service_connection_state", - "provisioning_state", - ] - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - location: Optional[str] = None, - properties: Optional["_models.RegistryPrivateEndpointConnectionProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class RegistryPrivateEndpointConnectionProperties(_Model): # pylint: disable=name-too-long - """Properties of the Private Endpoint Connection. - - :ivar group_ids: The group ids. - :vartype group_ids: list[str] - :ivar private_endpoint: The PE network resource that is linked to this PE connection. - :vartype private_endpoint: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointResource - :ivar registry_private_link_service_connection_state: The connection state. - :vartype registry_private_link_service_connection_state: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegistryPrivateLinkServiceConnectionState - :ivar provisioning_state: One of null, "Succeeded", "Provisioning", "Failed". While not - approved, it's null. - :vartype provisioning_state: str - """ - - group_ids: Optional[list[str]] = rest_field( - name="groupIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The group ids.""" - private_endpoint: Optional["_models.PrivateEndpointResource"] = rest_field( - name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] - ) - """The PE network resource that is linked to this PE connection.""" - registry_private_link_service_connection_state: Optional["_models.RegistryPrivateLinkServiceConnectionState"] = ( - rest_field( - name="registryPrivateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] - ) - ) - """The connection state.""" - provisioning_state: Optional[str] = rest_field( - name="provisioningState", visibility=["read", "create", "update", "delete", "query"] - ) - """One of null, \"Succeeded\", \"Provisioning\", \"Failed\". While not approved, it's null.""" - - @overload - def __init__( - self, - *, - group_ids: Optional[list[str]] = None, - private_endpoint: Optional["_models.PrivateEndpointResource"] = None, - registry_private_link_service_connection_state: Optional[ - "_models.RegistryPrivateLinkServiceConnectionState" - ] = None, - provisioning_state: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RegistryPrivateLinkServiceConnectionState(_Model): # pylint: disable=name-too-long - """The connection state. - - :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. - :vartype actions_required: str - :ivar description: User-defined message that, per NRP doc, may be used for approval-related - message. - :vartype description: str - :ivar status: Connection status of the service consumer with the service provider. Known values - are: "Approved", "Pending", "Rejected", "Disconnected", and "Timeout". - :vartype status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointServiceConnectionStatus - """ - - actions_required: Optional[str] = rest_field( - name="actionsRequired", visibility=["read", "create", "update", "delete", "query"] - ) - """Some RP chose \"None\". Other RPs use this for region expansion.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """User-defined message that, per NRP doc, may be used for approval-related message.""" - status: Optional[Union[str, "_models.EndpointServiceConnectionStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Connection status of the service consumer with the service provider. Known values are: - \"Approved\", \"Pending\", \"Rejected\", \"Disconnected\", and \"Timeout\".""" - - @overload - def __init__( - self, - *, - actions_required: Optional[str] = None, - description: Optional[str] = None, - status: Optional[Union[str, "_models.EndpointServiceConnectionStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RegistryProperties(_Model): - """Details of the Registry. - - :ivar discovery_url: Discovery URL for the Registry. - :vartype discovery_url: str - :ivar intellectual_property_publisher: IntellectualPropertyPublisher for the registry. - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: ResourceId of the managed RG if the registry has system created - resources. - :vartype managed_resource_group: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ArmResourceId - :ivar managed_resource_group_settings: Managed resource group specific settings. - :vartype managed_resource_group_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedResourceGroupSettings - :ivar ml_flow_registry_uri: MLFlow Registry URI for the Registry. - :vartype ml_flow_registry_uri: str - :ivar registry_private_endpoint_connections: Private endpoint connections info used for pending - connections in private link portal. - :vartype registry_private_endpoint_connections: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegistryPrivateEndpointConnection] - :ivar public_network_access: Is the Registry accessible from the internet? Possible values: - "Enabled" or "Disabled". - :vartype public_network_access: str - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegistryRegionArmDetails] - """ - - discovery_url: Optional[str] = rest_field( - name="discoveryUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Discovery URL for the Registry.""" - intellectual_property_publisher: Optional[str] = rest_field( - name="intellectualPropertyPublisher", visibility=["read", "create", "update", "delete", "query"] - ) - """IntellectualPropertyPublisher for the registry.""" - managed_resource_group: Optional["_models.ArmResourceId"] = rest_field( - name="managedResourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """ResourceId of the managed RG if the registry has system created resources.""" - managed_resource_group_settings: Optional["_models.ManagedResourceGroupSettings"] = rest_field( - name="managedResourceGroupSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Managed resource group specific settings.""" - ml_flow_registry_uri: Optional[str] = rest_field( - name="mlFlowRegistryUri", visibility=["read", "create", "update", "delete", "query"] - ) - """MLFlow Registry URI for the Registry.""" - registry_private_endpoint_connections: Optional[list["_models.RegistryPrivateEndpointConnection"]] = rest_field( - name="registryPrivateEndpointConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """Private endpoint connections info used for pending connections in private link portal.""" - public_network_access: Optional[str] = rest_field( - name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Is the Registry accessible from the internet? Possible values: \"Enabled\" or \"Disabled\".""" - region_details: Optional[list["_models.RegistryRegionArmDetails"]] = rest_field( - name="regionDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Details of each region the registry is in.""" - - @overload - def __init__( - self, - *, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["_models.ArmResourceId"] = None, - managed_resource_group_settings: Optional["_models.ManagedResourceGroupSettings"] = None, - ml_flow_registry_uri: Optional[str] = None, - registry_private_endpoint_connections: Optional[list["_models.RegistryPrivateEndpointConnection"]] = None, - public_network_access: Optional[str] = None, - region_details: Optional[list["_models.RegistryRegionArmDetails"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RegistryRegionArmDetails(_Model): - """Details for each region the registry is in. - - :ivar acr_details: List of ACR accounts. - :vartype acr_details: list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AcrDetails] - :ivar location: The location where the registry exists. - :vartype location: str - :ivar storage_account_details: List of storage accounts. - :vartype storage_account_details: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StorageAccountDetails] - """ - - acr_details: Optional[list["_models.AcrDetails"]] = rest_field( - name="acrDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """List of ACR accounts.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The location where the registry exists.""" - storage_account_details: Optional[list["_models.StorageAccountDetails"]] = rest_field( - name="storageAccountDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """List of storage accounts.""" - - @overload - def __init__( - self, - *, - acr_details: Optional[list["_models.AcrDetails"]] = None, - location: Optional[str] = None, - storage_account_details: Optional[list["_models.StorageAccountDetails"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Regression(AutoMLVertical, discriminator="Regression"): - """Regression task in AutoML Table vertical. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar cv_split_column_names: Columns to use for CVSplit data. - :vartype cv_split_column_names: list[str] - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TableVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TableVerticalLimitSettings - :ivar n_cross_validations: Number of cross validation folds to be applied on training dataset - when validation dataset is not provided. - :vartype n_cross_validations: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NCrossValidations - :ivar test_data: Test data input. - :vartype test_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar test_data_size: The fraction of test dataset that needs to be set aside for validation - purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype test_data_size: float - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar weight_column_name: The name of the sample weight column. Automated ML supports a - weighted column as an input, causing rows in the data to be weighted up or down. - :vartype weight_column_name: str - :ivar primary_metric: Primary metrics for Regression task. Known values are: - "SpearmanCorrelation", "NormalizedRootMeanSquaredError", "R2Score", and - "NormalizedMeanAbsoluteError". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegressionPrimaryMetrics - :ivar training_settings: Inputs for training phase for an AutoML Job. - :vartype training_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegressionTrainingSettings - :ivar task_type: [Required] Task type for AutoMLJob. Required. Regression means to predict the - value using the input data. Regression models are used to predict a continuous value. - :vartype task_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.REGRESSION - """ - - cv_split_column_names: Optional[list[str]] = rest_field( - name="cvSplitColumnNames", visibility=["read", "create", "update", "delete", "query"] - ) - """Columns to use for CVSplit data.""" - featurization_settings: Optional["_models.TableVerticalFeaturizationSettings"] = rest_field( - name="featurizationSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Featurization inputs needed for AutoML job.""" - limit_settings: Optional["_models.TableVerticalLimitSettings"] = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Execution constraints for AutoMLJob.""" - n_cross_validations: Optional["_models.NCrossValidations"] = rest_field( - name="nCrossValidations", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of cross validation folds to be applied on training dataset when validation dataset is - not provided.""" - test_data: Optional["_models.MLTableJobInput"] = rest_field( - name="testData", visibility=["read", "create", "update", "delete", "query"] - ) - """Test data input.""" - test_data_size: Optional[float] = rest_field( - name="testDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of test dataset that needs to be set aside for validation purpose. Values between - (0.0 , 1.0) Applied when validation dataset is not provided.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - validation_data_size: Optional[float] = rest_field( - name="validationDataSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The fraction of training dataset that needs to be set aside for validation purpose. Values - between (0.0 , 1.0) Applied when validation dataset is not provided.""" - weight_column_name: Optional[str] = rest_field( - name="weightColumnName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the sample weight column. Automated ML supports a weighted column as an input, - causing rows in the data to be weighted up or down.""" - primary_metric: Optional[Union[str, "_models.RegressionPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for Regression task. Known values are: \"SpearmanCorrelation\", - \"NormalizedRootMeanSquaredError\", \"R2Score\", and \"NormalizedMeanAbsoluteError\".""" - training_settings: Optional["_models.RegressionTrainingSettings"] = rest_field( - name="trainingSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Inputs for training phase for an AutoML Job.""" - task_type: Literal[TaskType.REGRESSION] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Regression means to predict the value using the - input data. Regression models are used to predict a continuous value.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - cv_split_column_names: Optional[list[str]] = None, - featurization_settings: Optional["_models.TableVerticalFeaturizationSettings"] = None, - limit_settings: Optional["_models.TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["_models.NCrossValidations"] = None, - test_data: Optional["_models.MLTableJobInput"] = None, - test_data_size: Optional[float] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - validation_data_size: Optional[float] = None, - weight_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "_models.RegressionPrimaryMetrics"]] = None, - training_settings: Optional["_models.RegressionTrainingSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.REGRESSION # type: ignore - - -class RegressionTrainingSettings(TrainingSettings): - """Regression Training related configuration. - - :ivar enable_dnn_training: Enable recommendation of DNN models. - :vartype enable_dnn_training: bool - :ivar enable_model_explainability: Flag to turn on explainability on best model. - :vartype enable_model_explainability: bool - :ivar enable_onnx_compatible_models: Flag for enabling onnx compatible models. - :vartype enable_onnx_compatible_models: bool - :ivar enable_stack_ensemble: Enable stack ensemble run. - :vartype enable_stack_ensemble: bool - :ivar enable_vote_ensemble: Enable voting ensemble run. - :vartype enable_vote_ensemble: bool - :ivar ensemble_model_download_timeout: During VotingEnsemble and StackEnsemble model - generation, multiple fitted models from the previous child runs are downloaded. Configure this - parameter with a higher value than 300 secs, if more time is needed. - :vartype ensemble_model_download_timeout: ~datetime.timedelta - :ivar stack_ensemble_settings: Stack ensemble settings for stack ensemble run. - :vartype stack_ensemble_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StackEnsembleSettings - :ivar allowed_training_algorithms: Allowed models for regression task. - :vartype allowed_training_algorithms: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegressionModels] - :ivar blocked_training_algorithms: Blocked models for regression task. - :vartype blocked_training_algorithms: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegressionModels] - """ - - allowed_training_algorithms: Optional[list[Union[str, "_models.RegressionModels"]]] = rest_field( - name="allowedTrainingAlgorithms", visibility=["read", "create", "update", "delete", "query"] - ) - """Allowed models for regression task.""" - blocked_training_algorithms: Optional[list[Union[str, "_models.RegressionModels"]]] = rest_field( - name="blockedTrainingAlgorithms", visibility=["read", "create", "update", "delete", "query"] - ) - """Blocked models for regression task.""" - - @overload - def __init__( - self, - *, - enable_dnn_training: Optional[bool] = None, - enable_model_explainability: Optional[bool] = None, - enable_onnx_compatible_models: Optional[bool] = None, - enable_stack_ensemble: Optional[bool] = None, - enable_vote_ensemble: Optional[bool] = None, - ensemble_model_download_timeout: Optional[datetime.timedelta] = None, - stack_ensemble_settings: Optional["_models.StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[list[Union[str, "_models.RegressionModels"]]] = None, - blocked_training_algorithms: Optional[list[Union[str, "_models.RegressionModels"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RequestConfiguration(_Model): - """Scoring requests configuration. - - :ivar max_concurrent_requests_per_instance: The number of maximum concurrent requests per node - allowed per deployment. Defaults to 1. - :vartype max_concurrent_requests_per_instance: int - :ivar request_timeout: The scoring timeout in ISO 8601 format. Defaults to 5000ms. - :vartype request_timeout: ~datetime.timedelta - """ - - max_concurrent_requests_per_instance: Optional[int] = rest_field( - name="maxConcurrentRequestsPerInstance", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of maximum concurrent requests per node allowed per deployment. Defaults to 1.""" - request_timeout: Optional[datetime.timedelta] = rest_field( - name="requestTimeout", visibility=["read", "create", "update", "delete", "query"] - ) - """The scoring timeout in ISO 8601 format. Defaults to 5000ms.""" - - @overload - def __init__( - self, - *, - max_concurrent_requests_per_instance: Optional[int] = None, - request_timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RequestLogging(_Model): - """RequestLogging. - - :ivar capture_headers: For payload logging, we only collect payload by default. If customers - also want to collect the specified headers, they can set them in captureHeaders so that backend - will collect those headers along with payload. - :vartype capture_headers: list[str] - """ - - capture_headers: Optional[list[str]] = rest_field( - name="captureHeaders", visibility=["read", "create", "update", "delete", "query"] - ) - """For payload logging, we only collect payload by default. If customers also want to collect the - specified headers, they can set them in captureHeaders so that backend will collect those - headers along with payload.""" - - @overload - def __init__( - self, - *, - capture_headers: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ResizeSchema(_Model): - """Schema for Compute Instance resize. - - :ivar target_vm_size: The name of the virtual machine size. - :vartype target_vm_size: str - """ - - target_vm_size: Optional[str] = rest_field( - name="targetVMSize", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the virtual machine size.""" - - @overload - def __init__( - self, - *, - target_vm_size: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ResourceId(_Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - :ivar id: The ID of the resource. Required. - :vartype id: str - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the resource. Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ResourceName(_Model): - """The Resource Name. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - value: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - localized_value: Optional[str] = rest_field(name="localizedValue", visibility=["read"]) - """The localized name of the resource.""" - - -class ResourceQuota(_Model): - """The quota assigned to a resource. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResourceName - :ivar limit: Limit. - :vartype limit: int - :ivar unit: An enum describing the unit of quota measurement. "Count" - :vartype unit: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaUnit - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Specifies the resource ID.""" - aml_workspace_location: Optional[str] = rest_field(name="amlWorkspaceLocation", visibility=["read"]) - """Region of the AML workspace in the id.""" - type: Optional[str] = rest_field(visibility=["read"]) - """Specifies the resource type.""" - name: Optional["_models.ResourceName"] = rest_field(visibility=["read"]) - """Name of the resource.""" - limit: Optional[int] = rest_field(visibility=["read"]) - """Limit.""" - unit: Optional[Union[str, "_models.QuotaUnit"]] = rest_field(visibility=["read"]) - """An enum describing the unit of quota measurement. \"Count\"""" - - -class RollingInputData(MonitoringInputDataBase, discriminator="Rolling"): - """Rolling input data definition. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar job_input_type: [Required] Specifies the type of job. Required. Known values are: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", and - "triton_model". - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInputType - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_offset: [Required] The time offset between the end of the data window and the - monitor's current run time. Required. - :vartype window_offset: ~datetime.timedelta - :ivar window_size: [Required] The size of the rolling data window. Required. - :vartype window_size: ~datetime.timedelta - :ivar input_data_type: [Required] Specifies the type of signal to monitor. Required. An input - data which rolls relatively to the monitor's current run time. - :vartype input_data_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ROLLING - """ - - preprocessing_component_id: Optional[str] = rest_field( - name="preprocessingComponentId", visibility=["read", "create"] - ) - """Reference to the component asset used to preprocess the data.""" - window_offset: datetime.timedelta = rest_field(name="windowOffset", visibility=["read", "create"]) - """[Required] The time offset between the end of the data window and the monitor's current run - time. Required.""" - window_size: datetime.timedelta = rest_field(name="windowSize", visibility=["read", "create"]) - """[Required] The size of the rolling data window. Required.""" - input_data_type: Literal[MonitoringInputDataType.ROLLING] = rest_discriminator(name="inputDataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. An input data which rolls - relatively to the monitor's current run time.""" - - @overload - def __init__( - self, - *, - job_input_type: Union[str, "_models.JobInputType"], - uri: str, - window_offset: datetime.timedelta, - window_size: datetime.timedelta, - columns: Optional[dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.input_data_type = MonitoringInputDataType.ROLLING # type: ignore - - -class Route(_Model): - """Route. - - :ivar path: [Required] The path for the route. Required. - :vartype path: str - :ivar port: [Required] The port for the route. Required. - :vartype port: int - """ - - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] The path for the route. Required.""" - port: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] The port for the route. Required.""" - - @overload - def __init__( - self, - *, - path: str, - port: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2, discriminator="SAS"): - """SASAuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionSharedAccessSignature - :ivar auth_type: Authentication type of the connection target. Required. SAS. - :vartype auth_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SAS - """ - - credentials: Optional["_models.WorkspaceConnectionSharedAccessSignature"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.SAS] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. SAS.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionSharedAccessSignature"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.SAS # type: ignore - - -class SASCredential(DataReferenceCredential, discriminator="SAS"): - """Access with full SAS uri. - - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - :ivar credential_type: [Required] Credential type used to authentication with storage. - Required. SAS. - :vartype credential_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SAS - """ - - sas_uri: Optional[str] = rest_field(name="sasUri", visibility=["read", "create", "update", "delete", "query"]) - """Full SAS Uri, including the storage, container/blob path and SAS token.""" - credential_type: Literal[DataReferenceCredentialType.SAS] = rest_discriminator(name="credentialType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. SAS.""" - - @overload - def __init__( - self, - *, - sas_uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credential_type = DataReferenceCredentialType.SAS # type: ignore - - -class SASCredentialDto(PendingUploadCredentialDto, discriminator="SAS"): - """SASCredentialDto. - - :ivar sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. - :vartype sas_uri: str - :ivar credential_type: [Required] Credential type used to authentication with storage. - Required. SAS. - :vartype credential_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SAS - """ - - sas_uri: Optional[str] = rest_field(name="sasUri", visibility=["read", "create", "update", "delete", "query"]) - """Full SAS Uri, including the storage, container/blob path and SAS token.""" - credential_type: Literal[PendingUploadCredentialType.SAS] = rest_discriminator(name="credentialType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. SAS.""" - - @overload - def __init__( - self, - *, - sas_uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credential_type = PendingUploadCredentialType.SAS # type: ignore - - -class SasDatastoreCredentials(DatastoreCredentials, discriminator="Sas"): - """SAS datastore credentials configuration. - - :ivar secrets: [Required] Storage container secrets. Required. - :vartype secrets: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SasDatastoreSecrets - :ivar credentials_type: [Required] Credential type used to authentication with storage. - Required. SAS. - :vartype credentials_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SAS - """ - - secrets: "_models.SasDatastoreSecrets" = rest_field(visibility=["create", "update"]) - """[Required] Storage container secrets. Required.""" - credentials_type: Literal[CredentialsType.SAS] = rest_discriminator(name="credentialsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. SAS.""" - - @overload - def __init__( - self, - *, - secrets: "_models.SasDatastoreSecrets", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credentials_type = CredentialsType.SAS # type: ignore - - -class SasDatastoreSecrets(DatastoreSecrets, discriminator="Sas"): - """Datastore SAS secrets. - - :ivar sas_token: Storage container SAS token. - :vartype sas_token: str - :ivar secrets_type: [Required] Credential type used to authentication with storage. Required. - SAS. - :vartype secrets_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SAS - """ - - sas_token: Optional[str] = rest_field(name="sasToken", visibility=["read", "create", "update", "delete", "query"]) - """Storage container SAS token.""" - secrets_type: Literal[SecretsType.SAS] = rest_discriminator(name="secretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. SAS.""" - - @overload - def __init__( - self, - *, - sas_token: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.secrets_type = SecretsType.SAS # type: ignore - - -class ScaleSettings(_Model): - """scale settings for AML Compute. - - :ivar max_node_count: Max number of nodes to use. Required. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - max_node_count: int = rest_field(name="maxNodeCount", visibility=["read", "create", "update", "delete", "query"]) - """Max number of nodes to use. Required.""" - min_node_count: Optional[int] = rest_field( - name="minNodeCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Min number of nodes to use.""" - node_idle_time_before_scale_down: Optional[datetime.timedelta] = rest_field( - name="nodeIdleTimeBeforeScaleDown", visibility=["read", "create", "update", "delete", "query"] - ) - """Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format.""" - - @overload - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = None, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ScaleSettingsInformation(_Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: Scale settings. - :vartype scale_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScaleSettings - """ - - scale_settings: Optional["_models.ScaleSettings"] = rest_field( - name="scaleSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Scale settings.""" - - @overload - def __init__( - self, - *, - scale_settings: Optional["_models.ScaleSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ScaleUnitConfiguration(_Model): - """Configuration for ScaleUnit pool. - - :ivar disable_public_egress: Gets or sets a value indicating whether PublicEgress is disabled. - :vartype disable_public_egress: bool - :ivar registries: Gets or sets a list of Registry sources that will be used to confirm - identity, storage, ACR. - :vartype registries: list[str] - """ - - disable_public_egress: Optional[bool] = rest_field( - name="disablePublicEgress", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets a value indicating whether PublicEgress is disabled.""" - registries: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets a list of Registry sources that will be used to confirm identity, storage, ACR.""" - - @overload - def __init__( - self, - *, - disable_public_egress: Optional[bool] = None, - registries: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Schedule(ProxyResource): - """Azure Resource Manager resource envelope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleProperties - """ - - properties: "_models.ScheduleProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Additional attributes of the entity. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.ScheduleProperties", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ScheduleBase(_Model): - """ScheduleBase. - - :ivar id: A system assigned id for the schedule. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Known values are: - "Completed", "Provisioning", and "Failed". - :vartype provisioning_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleProvisioningState - :ivar status: Is the schedule enabled or disabled?. Known values are: "Enabled" and "Disabled". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleStatus - """ - - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A system assigned id for the schedule.""" - provisioning_status: Optional[Union[str, "_models.ScheduleProvisioningState"]] = rest_field( - name="provisioningStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """The current deployment state of schedule. Known values are: \"Completed\", \"Provisioning\", - and \"Failed\".""" - status: Optional[Union[str, "_models.ScheduleStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is the schedule enabled or disabled?. Known values are: \"Enabled\" and \"Disabled\".""" - - @overload - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - provisioning_status: Optional[Union[str, "_models.ScheduleProvisioningState"]] = None, - status: Optional[Union[str, "_models.ScheduleStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ScheduleProperties(ResourceBase): - """Base definition of a schedule. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar action: [Required] Specifies the action of the schedule. Required. - :vartype action: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleActionBase - :ivar display_name: Display name of schedule. - :vartype display_name: str - :ivar is_enabled: Is the schedule enabled?. - :vartype is_enabled: bool - :ivar provisioning_state: Provisioning state for the schedule. Known values are: "Creating", - "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleProvisioningStatus - :ivar trigger: [Required] Specifies the trigger details. Required. - :vartype trigger: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TriggerBase - """ - - action: "_models.ScheduleActionBase" = rest_field(visibility=["read", "create", "update"]) - """[Required] Specifies the action of the schedule. Required.""" - display_name: Optional[str] = rest_field(name="displayName", visibility=["read", "create"]) - """Display name of schedule.""" - is_enabled: Optional[bool] = rest_field(name="isEnabled", visibility=["read", "create", "update"]) - """Is the schedule enabled?.""" - provisioning_state: Optional[Union[str, "_models.ScheduleProvisioningStatus"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the schedule. Known values are: \"Creating\", \"Updating\", - \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - trigger: "_models.TriggerBase" = rest_field(visibility=["read", "create", "update"]) - """[Required] Specifies the trigger details. Required.""" - - @overload - def __init__( - self, - *, - action: "_models.ScheduleActionBase", - trigger: "_models.TriggerBase", - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - display_name: Optional[str] = None, - is_enabled: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ScriptReference(_Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - script_source: Optional[str] = rest_field( - name="scriptSource", visibility=["read", "create", "update", "delete", "query"] - ) - """The storage source of the script: inline, workspace.""" - script_data: Optional[str] = rest_field( - name="scriptData", visibility=["read", "create", "update", "delete", "query"] - ) - """The location of scripts in the mounted volume.""" - script_arguments: Optional[str] = rest_field( - name="scriptArguments", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional command line arguments passed to the script to run.""" - timeout: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional time period passed to timeout command.""" - - @overload - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ScriptsToExecute(_Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScriptReference - """ - - startup_script: Optional["_models.ScriptReference"] = rest_field( - name="startupScript", visibility=["read", "create", "update", "delete", "query"] - ) - """Script that's run every time the machine starts.""" - creation_script: Optional["_models.ScriptReference"] = rest_field( - name="creationScript", visibility=["read", "create", "update", "delete", "query"] - ) - """Script that's run only once during provision of the compute.""" - - @overload - def __init__( - self, - *, - startup_script: Optional["_models.ScriptReference"] = None, - creation_script: Optional["_models.ScriptReference"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SecretExpiry(_Model): - """Secret expiration configuration. - - :ivar expirable_secret: Indicates if the secret is expirable. - :vartype expirable_secret: bool - :ivar expire_after_hours: Number of hours after which the secret will expire. - :vartype expire_after_hours: int - """ - - expirable_secret: Optional[bool] = rest_field( - name="expirableSecret", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates if the secret is expirable.""" - expire_after_hours: Optional[int] = rest_field( - name="expireAfterHours", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of hours after which the secret will expire.""" - - @overload - def __init__( - self, - *, - expirable_secret: Optional[bool] = None, - expire_after_hours: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServerlessComputeSettings(_Model): - """ServerlessComputeSettings. - - :ivar serverless_compute_custom_subnet: The resource ID of an existing virtual network subnet - in which serverless compute nodes should be deployed. - :vartype serverless_compute_custom_subnet: str - :ivar serverless_compute_no_public_ip: The flag to signal if serverless compute nodes deployed - in custom vNet would have no public IP addresses for a workspace with private endpoint. - :vartype serverless_compute_no_public_ip: bool - """ - - serverless_compute_custom_subnet: Optional[str] = rest_field( - name="serverlessComputeCustomSubnet", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource ID of an existing virtual network subnet in which serverless compute nodes should - be deployed.""" - serverless_compute_no_public_ip: Optional[bool] = rest_field( - name="serverlessComputeNoPublicIP", visibility=["read", "create", "update", "delete", "query"] - ) - """The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP - addresses for a workspace with private endpoint.""" - - @overload - def __init__( - self, - *, - serverless_compute_custom_subnet: Optional[str] = None, - serverless_compute_no_public_ip: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServerlessEndpoint(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpointProperties - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar sku: Sku details required for ARM contract for Autoscaling. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - """ - - properties: "_models.ServerlessEndpointProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Managed service identity (system assigned and/or user assigned identities).""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku details required for ARM contract for Autoscaling.""" - - @overload - def __init__( - self, - *, - location: str, - properties: "_models.ServerlessEndpointProperties", - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServerlessEndpointCapacityReservation(_Model): - """ServerlessEndpointCapacityReservation. - - :ivar capacity_reservation_group_id: Required. - :vartype capacity_reservation_group_id: str - :ivar endpoint_reserved_capacity: - :vartype endpoint_reserved_capacity: int - """ - - capacity_reservation_group_id: str = rest_field( - name="capacityReservationGroupId", visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - endpoint_reserved_capacity: Optional[int] = rest_field( - name="endpointReservedCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - capacity_reservation_group_id: str, - endpoint_reserved_capacity: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServerlessEndpointContentSafety(_Model): - """ServerlessEndpointContentSafety. - - :ivar content_safety_status: Specifies the status of content safety. Required. Known values - are: "Enabled" and "Disabled". - :vartype content_safety_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContentSafetyStatus - """ - - content_safety_status: Union[str, "_models.ContentSafetyStatus"] = rest_field( - name="contentSafetyStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the status of content safety. Required. Known values are: \"Enabled\" and - \"Disabled\".""" - - @overload - def __init__( - self, - *, - content_safety_status: Union[str, "_models.ContentSafetyStatus"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServerlessEndpointInferenceEndpoint(_Model): - """ServerlessEndpointInferenceEndpoint. - - :ivar headers: - :vartype headers: dict[str, str] - :ivar uri: Required. - :vartype uri: str - """ - - headers: Optional[dict[str, str]] = rest_field(visibility=["read"]) - uri: str = rest_field(visibility=["read"]) - """Required.""" - - -class ServerlessEndpointModelSettings(_Model): - """ServerlessEndpointModelSettings. - - :ivar model_id: Required. - :vartype model_id: str - """ - - model_id: str = rest_field(name="modelId", visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - model_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServerlessEndpointProperties(_Model): - """ServerlessEndpointProperties. - - :ivar auth_mode: [Required] Specifies the authentication mode for the Serverless endpoint. - Required. Known values are: "Key", "AAD", and "KeyAndAAD". - :vartype auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessInferenceEndpointAuthMode - :ivar content_safety: Specifies the content safety options. If omitted, the default content - safety settings will be configured. - :vartype content_safety: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ContentSafety - :ivar endpoint_state: The current state of the ServerlessEndpoint. Known values are: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - and "DeletionFailed". - :vartype endpoint_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpointState - :ivar inference_endpoint: The inference uri to target when making requests against the - serverless endpoint. - :vartype inference_endpoint: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessInferenceEndpoint - :ivar marketplace_subscription_id: The MarketplaceSubscription Azure ID associated to this - ServerlessEndpoint. - :vartype marketplace_subscription_id: str - :ivar model_settings: The model settings (model id) for the model being serviced on the - ServerlessEndpoint. - :vartype model_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelSettings - :ivar provisioning_state: State of endpoint provisioning. Known values are: "Creating", - "Deleting", "Succeeded", "Failed", "Updating", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointProvisioningState - """ - - auth_mode: Union[str, "_models.ServerlessInferenceEndpointAuthMode"] = rest_field( - name="authMode", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Specifies the authentication mode for the Serverless endpoint. Required. Known - values are: \"Key\", \"AAD\", and \"KeyAndAAD\".""" - content_safety: Optional["_models.ContentSafety"] = rest_field( - name="contentSafety", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the content safety options. If omitted, the default content safety settings will be - configured.""" - endpoint_state: Optional[Union[str, "_models.ServerlessEndpointState"]] = rest_field( - name="endpointState", visibility=["read"] - ) - """The current state of the ServerlessEndpoint. Known values are: \"Unknown\", \"Creating\", - \"Deleting\", \"Suspending\", \"Reinstating\", \"Online\", \"Suspended\", \"CreationFailed\", - and \"DeletionFailed\".""" - inference_endpoint: Optional["_models.ServerlessInferenceEndpoint"] = rest_field( - name="inferenceEndpoint", visibility=["read"] - ) - """The inference uri to target when making requests against the serverless endpoint.""" - marketplace_subscription_id: Optional[str] = rest_field(name="marketplaceSubscriptionId", visibility=["read"]) - """The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint.""" - model_settings: Optional["_models.ModelSettings"] = rest_field( - name="modelSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """The model settings (model id) for the model being serviced on the ServerlessEndpoint.""" - provisioning_state: Optional[Union[str, "_models.EndpointProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """State of endpoint provisioning. Known values are: \"Creating\", \"Deleting\", \"Succeeded\", - \"Failed\", \"Updating\", and \"Canceled\".""" - - @overload - def __init__( - self, - *, - auth_mode: Union[str, "_models.ServerlessInferenceEndpointAuthMode"], - content_safety: Optional["_models.ContentSafety"] = None, - model_settings: Optional["_models.ModelSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServerlessEndpointResourceProperties(EndpointResourceProperties, discriminator="serverlessEndpoint"): - """ServerlessEndpointResourceProperties. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. Since input dto and when parse endpoint resource - share the same contract this Location field is just for parse the endpoint resource info we - won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar auth_mode: Known values are: "Key", "AAD", and "KeyAndAAD". - :vartype auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessInferenceEndpointAuthMode - :ivar capacity_reservation: - :vartype capacity_reservation: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpointCapacityReservation - :ivar content_safety: - :vartype content_safety: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpointContentSafety - :ivar endpoint_state: State of the Serverless Endpoint. Known values are: "Unknown", - "Creating", "Deleting", "Suspending", "Reinstating", "Online", "Suspended", "CreationFailed", - and "DeletionFailed". - :vartype endpoint_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpointState - :ivar inference_endpoint: - :vartype inference_endpoint: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpointInferenceEndpoint - :ivar marketplace_subscription_id: - :vartype marketplace_subscription_id: str - :ivar metadata: - :vartype metadata: any - :ivar model_settings: - :vartype model_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpointModelSettings - :ivar offer: - :vartype offer: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessOffer - :ivar endpoint_type: Type of the endpoint. Required. SERVERLESS_ENDPOINT. - :vartype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SERVERLESS_ENDPOINT - """ - - auth_mode: Optional[Union[str, "_models.ServerlessInferenceEndpointAuthMode"]] = rest_field( - name="authMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"Key\", \"AAD\", and \"KeyAndAAD\".""" - capacity_reservation: Optional["_models.ServerlessEndpointCapacityReservation"] = rest_field( - name="capacityReservation", visibility=["read", "create", "update", "delete", "query"] - ) - content_safety: Optional["_models.ServerlessEndpointContentSafety"] = rest_field( - name="contentSafety", visibility=["read", "create", "update", "delete", "query"] - ) - endpoint_state: Optional[Union[str, "_models.ServerlessEndpointState"]] = rest_field( - name="endpointState", visibility=["read", "create", "update", "delete", "query"] - ) - """State of the Serverless Endpoint. Known values are: \"Unknown\", \"Creating\", \"Deleting\", - \"Suspending\", \"Reinstating\", \"Online\", \"Suspended\", \"CreationFailed\", and - \"DeletionFailed\".""" - inference_endpoint: Optional["_models.ServerlessEndpointInferenceEndpoint"] = rest_field( - name="inferenceEndpoint", visibility=["read", "create", "update", "delete", "query"] - ) - marketplace_subscription_id: Optional[str] = rest_field( - name="marketplaceSubscriptionId", visibility=["read", "create", "update", "delete", "query"] - ) - metadata: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - model_settings: Optional["_models.ServerlessEndpointModelSettings"] = rest_field( - name="modelSettings", visibility=["read", "create", "update", "delete", "query"] - ) - offer: Optional["_models.ServerlessOffer"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - endpoint_type: Literal[EndpointType.SERVERLESS_ENDPOINT] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of the endpoint. Required. SERVERLESS_ENDPOINT.""" - - @overload - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[list["_models.EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - auth_mode: Optional[Union[str, "_models.ServerlessInferenceEndpointAuthMode"]] = None, - capacity_reservation: Optional["_models.ServerlessEndpointCapacityReservation"] = None, - content_safety: Optional["_models.ServerlessEndpointContentSafety"] = None, - endpoint_state: Optional[Union[str, "_models.ServerlessEndpointState"]] = None, - inference_endpoint: Optional["_models.ServerlessEndpointInferenceEndpoint"] = None, - marketplace_subscription_id: Optional[str] = None, - metadata: Optional[Any] = None, - model_settings: Optional["_models.ServerlessEndpointModelSettings"] = None, - offer: Optional["_models.ServerlessOffer"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.endpoint_type = EndpointType.SERVERLESS_ENDPOINT # type: ignore - - -class ServerlessInferenceEndpoint(_Model): - """ServerlessInferenceEndpoint. - - :ivar headers: Specifies any required headers to target this serverless endpoint. - :vartype headers: dict[str, str] - :ivar uri: [Required] The inference uri to target when making requests against the Serverless - Endpoint. Required. - :vartype uri: str - """ - - headers: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """Specifies any required headers to target this serverless endpoint.""" - uri: str = rest_field(visibility=["read"]) - """[Required] The inference uri to target when making requests against the Serverless Endpoint. - Required.""" - - -class ServerlessOffer(_Model): - """ServerlessOffer. - - :ivar offer_name: Required. - :vartype offer_name: str - :ivar publisher: Required. - :vartype publisher: str - """ - - offer_name: str = rest_field(name="offerName", visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - publisher: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - offer_name: str, - publisher: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServiceManagedResourcesSettings(_Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: - :vartype cosmos_db: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CosmosDbSettings - """ - - cosmos_db: Optional["_models.CosmosDbSettings"] = rest_field( - name="cosmosDb", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - cosmos_db: Optional["_models.CosmosDbSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties( - WorkspaceConnectionPropertiesV2, discriminator="ServicePrincipal" -): # pylint: disable=name-too-long - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionServicePrincipal - :ivar auth_type: Authentication type of the connection target. Required. SERVICE_PRINCIPAL. - :vartype auth_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SERVICE_PRINCIPAL - """ - - credentials: Optional["_models.WorkspaceConnectionServicePrincipal"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.SERVICE_PRINCIPAL] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. SERVICE_PRINCIPAL.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionServicePrincipal"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.SERVICE_PRINCIPAL # type: ignore - - -class ServicePrincipalDatastoreCredentials(DatastoreCredentials, discriminator="ServicePrincipal"): - """Service Principal datastore credentials configuration. - - :ivar authority_url: Authority URL used for authentication. - :vartype authority_url: str - :ivar client_id: [Required] Service principal client ID. Required. - :vartype client_id: str - :ivar resource_url: Resource the service principal has access to. - :vartype resource_url: str - :ivar secrets: [Required] Service principal secrets. Required. - :vartype secrets: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServicePrincipalDatastoreSecrets - :ivar tenant_id: [Required] ID of the tenant to which the service principal belongs. Required. - :vartype tenant_id: str - :ivar credentials_type: [Required] Credential type used to authentication with storage. - Required. SERVICE_PRINCIPAL. - :vartype credentials_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SERVICE_PRINCIPAL - """ - - authority_url: Optional[str] = rest_field( - name="authorityUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Authority URL used for authentication.""" - client_id: str = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - """[Required] Service principal client ID. Required.""" - resource_url: Optional[str] = rest_field( - name="resourceUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Resource the service principal has access to.""" - secrets: "_models.ServicePrincipalDatastoreSecrets" = rest_field(visibility=["create", "update"]) - """[Required] Service principal secrets. Required.""" - tenant_id: str = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """[Required] ID of the tenant to which the service principal belongs. Required.""" - credentials_type: Literal[CredentialsType.SERVICE_PRINCIPAL] = rest_discriminator(name="credentialsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. SERVICE_PRINCIPAL.""" - - @overload - def __init__( - self, - *, - client_id: str, - secrets: "_models.ServicePrincipalDatastoreSecrets", - tenant_id: str, - authority_url: Optional[str] = None, - resource_url: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.credentials_type = CredentialsType.SERVICE_PRINCIPAL # type: ignore - - -class ServicePrincipalDatastoreSecrets(DatastoreSecrets, discriminator="ServicePrincipal"): - """Datastore Service Principal secrets. - - :ivar client_secret: Service principal secret. - :vartype client_secret: str - :ivar secrets_type: [Required] Credential type used to authentication with storage. Required. - SERVICE_PRINCIPAL. - :vartype secrets_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SERVICE_PRINCIPAL - """ - - client_secret: Optional[str] = rest_field( - name="clientSecret", visibility=["read", "create", "update", "delete", "query"] - ) - """Service principal secret.""" - secrets_type: Literal[SecretsType.SERVICE_PRINCIPAL] = rest_discriminator(name="secretsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Credential type used to authentication with storage. Required. SERVICE_PRINCIPAL.""" - - @overload - def __init__( - self, - *, - client_secret: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.secrets_type = SecretsType.SERVICE_PRINCIPAL # type: ignore - - -class ServiceTagDestination(_Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine - learning workspace. - - :ivar action: The action enum for networking rule. Known values are: "Allow" and "Deny". - :vartype action: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleAction - :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. - :vartype address_prefixes: list[str] - :ivar port_ranges: - :vartype port_ranges: str - :ivar protocol: - :vartype protocol: str - :ivar service_tag: - :vartype service_tag: str - """ - - action: Optional[Union[str, "_models.RuleAction"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The action enum for networking rule. Known values are: \"Allow\" and \"Deny\".""" - address_prefixes: Optional[list[str]] = rest_field( - name="addressPrefixes", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional, if provided, the ServiceTag property will be ignored.""" - port_ranges: Optional[str] = rest_field( - name="portRanges", visibility=["read", "create", "update", "delete", "query"] - ) - protocol: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - service_tag: Optional[str] = rest_field( - name="serviceTag", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - action: Optional[Union[str, "_models.RuleAction"]] = None, - address_prefixes: Optional[list[str]] = None, - port_ranges: Optional[str] = None, - protocol: Optional[str] = None, - service_tag: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ServiceTagOutboundRule(OutboundRule, discriminator="ServiceTag"): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar category: Category of a managed network Outbound Rule of a machine learning workspace. - Known values are: "Required", "Recommended", "UserDefined", and "Dependency". - :vartype category: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a machine learning workspace. Known - values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RuleStatus - :ivar error_information: Error information about an outbound rule of a machine learning - workspace if RuleStatus is failed. - :vartype error_information: str - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar destination: Service Tag destination for a Service Tag Outbound Rule for the managed - network of a machine learning workspace. - :vartype destination: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceTagDestination - :ivar type: Type of a managed network Outbound Rule of a machine learning workspace. Required. - SERVICE_TAG. - :vartype type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SERVICE_TAG - """ - - destination: Optional["_models.ServiceTagDestination"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine - learning workspace.""" - type: Literal[RuleType.SERVICE_TAG] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of a managed network Outbound Rule of a machine learning workspace. Required. SERVICE_TAG.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.RuleCategory"]] = None, - status: Optional[Union[str, "_models.RuleStatus"]] = None, - destination: Optional["_models.ServiceTagDestination"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = RuleType.SERVICE_TAG # type: ignore - - -class SetupScripts(_Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScriptsToExecute - """ - - scripts: Optional["_models.ScriptsToExecute"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Customized setup scripts.""" - - @overload - def __init__( - self, - *, - scripts: Optional["_models.ScriptsToExecute"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SharedPrivateLinkResource(_Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar properties: Properties of a shared private link resource. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SharedPrivateLinkResourceProperty - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Unique name of the private link.""" - properties: Optional["_models.SharedPrivateLinkResourceProperty"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of a shared private link resource.""" - - __flattened_items = ["group_id", "private_link_resource_id", "request_message", "status"] - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - properties: Optional["_models.SharedPrivateLinkResourceProperty"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class SharedPrivateLinkResourceProperty(_Model): - """Properties of a shared private link resource. - - :ivar group_id: group id of the private link. - :vartype group_id: str - :ivar private_link_resource_id: the resource id that private link links to. - :vartype private_link_resource_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Connection status of the service consumer with the service provider\\r\\nPossible - state transitions\\r\\nPending -> Approved (Service provider approves the connection - request)\\r\\nPending -> Rejected (Service provider rejects the connection - request)\\r\\nPending -> Disconnected (Service provider deletes the connection)\\r\\nApproved - -> Rejected (Service provider rejects the approved connection)\\r\\nApproved -> Disconnected - (Service provider deletes the connection)\\r\\nRejected -> Pending (Service consumer - re-initiates the connection request that was rejected)\\r\\nRejected -> Disconnected (Service - provider deletes the connection). Known values are: "Approved", "Pending", "Rejected", - "Disconnected", and "Timeout". - :vartype status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointServiceConnectionStatus - """ - - group_id: Optional[str] = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """group id of the private link.""" - private_link_resource_id: Optional[str] = rest_field( - name="privateLinkResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """the resource id that private link links to.""" - request_message: Optional[str] = rest_field( - name="requestMessage", visibility=["read", "create", "update", "delete", "query"] - ) - """Request message.""" - status: Optional[Union[str, "_models.EndpointServiceConnectionStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Connection status of the service consumer with the service provider\r\nPossible state - transitions\r\nPending -> Approved (Service provider approves the connection - request)\r\nPending -> Rejected (Service provider rejects the connection request)\r\nPending -> - Disconnected (Service provider deletes the connection)\r\nApproved -> Rejected (Service - provider rejects the approved connection)\r\nApproved -> Disconnected (Service provider deletes - the connection)\r\nRejected -> Pending (Service consumer re-initiates the connection request - that was rejected)\r\nRejected -> Disconnected (Service provider deletes the connection). Known - values are: \"Approved\", \"Pending\", \"Rejected\", \"Disconnected\", and \"Timeout\".""" - - @overload - def __init__( - self, - *, - group_id: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "_models.EndpointServiceConnectionStatus"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Sku(_Model): - """The resource model definition representing SKU. - - :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", - "Standard", and "Premium". - :vartype tier: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuTier - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the SKU. Ex - P3. It is typically a letter+number code. Required.""" - tier: Optional[Union[str, "_models.SkuTier"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", - and \"Premium\".""" - size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SKU size. When the name field is the combination of tier and some other value, this would - be the standalone code.""" - family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If the service has different generations of hardware, for the same SKU, then that can be - captured here.""" - capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in - is not possible for the resource this may be omitted.""" - - @overload - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "_models.SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SkuCapacity(_Model): - """SKU capacity information. - - :ivar default: Gets or sets the default capacity. - :vartype default: int - :ivar maximum: Gets or sets the maximum. - :vartype maximum: int - :ivar minimum: Gets or sets the minimum. - :vartype minimum: int - :ivar scale_type: Node scaling setting for the compute sku. Known values are: "Automatic", - "Manual", and "None". - :vartype scale_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuScaleType - """ - - default: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the default capacity.""" - maximum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the maximum.""" - minimum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the minimum.""" - scale_type: Optional[Union[str, "_models.SkuScaleType"]] = rest_field( - name="scaleType", visibility=["read", "create", "update", "delete", "query"] - ) - """Node scaling setting for the compute sku. Known values are: \"Automatic\", \"Manual\", and - \"None\".""" - - @overload - def __init__( - self, - *, - default: Optional[int] = None, - maximum: Optional[int] = None, - minimum: Optional[int] = None, - scale_type: Optional[Union[str, "_models.SkuScaleType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SkuResource(_Model): - """Fulfills ARM Contract requirement to list all available SKUS for a resource. - - :ivar capacity: Gets or sets the Sku Capacity. - :vartype capacity: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuCapacity - :ivar resource_type: The resource type name. - :vartype resource_type: str - :ivar sku: Gets or sets the Sku. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuSetting - """ - - capacity: Optional["_models.SkuCapacity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the Sku Capacity.""" - resource_type: Optional[str] = rest_field(name="resourceType", visibility=["read"]) - """The resource type name.""" - sku: Optional["_models.SkuSetting"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the Sku.""" - - @overload - def __init__( - self, - *, - capacity: Optional["_models.SkuCapacity"] = None, - sku: Optional["_models.SkuSetting"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SkuSetting(_Model): - """SkuSetting fulfills the need for stripped down SKU info in ARM contract. - - :ivar name: [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. - Required. - :vartype name: str - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", - "Standard", and "Premium". - :vartype tier: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuTier - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] The name of the SKU. Ex - P3. It is typically a letter+number code. Required.""" - tier: Optional[Union[str, "_models.SkuTier"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", - and \"Premium\".""" - - @overload - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "_models.SkuTier"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SparkJob(JobBaseProperties, discriminator="Spark"): - """Spark job definition. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - :ivar archives: Archive files used in the job. - :vartype archives: list[str] - :ivar args: Arguments for the job. - :vartype args: str - :ivar code_id: [Required] arm-id of the code asset. Required. - :vartype code_id: str - :ivar conf: Spark configured properties. - :vartype conf: dict[str, str] - :ivar entry: [Required] The entry to execute on startup of the job. Required. - :vartype entry: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SparkJobEntry - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar files: Files used in the job. - :vartype files: list[str] - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput] - :ivar jars: Jar files used in the job. - :vartype jars: list[str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutput] - :ivar py_files: Python files used in the job. - :vartype py_files: list[str] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SparkResourceConfiguration - :ivar job_type: [Required] Specifies the type of job. Required. SPARK. - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SPARK - """ - - archives: Optional[list[str]] = rest_field(visibility=["read", "create"]) - """Archive files used in the job.""" - args: Optional[str] = rest_field(visibility=["read", "create"]) - """Arguments for the job.""" - code_id: str = rest_field(name="codeId", visibility=["read", "create"]) - """[Required] arm-id of the code asset. Required.""" - conf: Optional[dict[str, str]] = rest_field(visibility=["read", "create"]) - """Spark configured properties.""" - entry: "_models.SparkJobEntry" = rest_field(visibility=["read", "create"]) - """[Required] The entry to execute on startup of the job. Required.""" - environment_id: Optional[str] = rest_field(name="environmentId", visibility=["read", "create"]) - """The ARM resource ID of the Environment specification for the job.""" - environment_variables: Optional[dict[str, str]] = rest_field( - name="environmentVariables", visibility=["read", "create"] - ) - """Environment variables included in the job.""" - files: Optional[list[str]] = rest_field(visibility=["read", "create"]) - """Files used in the job.""" - inputs: Optional[dict[str, "_models.JobInput"]] = rest_field(visibility=["read", "create"]) - """Mapping of input data bindings used in the job.""" - jars: Optional[list[str]] = rest_field(visibility=["read", "create"]) - """Jar files used in the job.""" - outputs: Optional[dict[str, "_models.JobOutput"]] = rest_field(visibility=["read", "create"]) - """Mapping of output data bindings used in the job.""" - py_files: Optional[list[str]] = rest_field(name="pyFiles", visibility=["read", "create"]) - """Python files used in the job.""" - queue_settings: Optional["_models.QueueSettings"] = rest_field(name="queueSettings", visibility=["read", "create"]) - """Queue settings for the job.""" - resources: Optional["_models.SparkResourceConfiguration"] = rest_field(visibility=["read", "create"]) - """Compute Resource configuration for the job.""" - job_type: Literal[JobType.SPARK] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. SPARK.""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - code_id: str, - entry: "_models.SparkJobEntry", - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - archives: Optional[list[str]] = None, - args: Optional[str] = None, - conf: Optional[dict[str, str]] = None, - environment_id: Optional[str] = None, - environment_variables: Optional[dict[str, str]] = None, - files: Optional[list[str]] = None, - inputs: Optional[dict[str, "_models.JobInput"]] = None, - jars: Optional[list[str]] = None, - outputs: Optional[dict[str, "_models.JobOutput"]] = None, - py_files: Optional[list[str]] = None, - queue_settings: Optional["_models.QueueSettings"] = None, - resources: Optional["_models.SparkResourceConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = JobType.SPARK # type: ignore - - -class SparkJobEntry(_Model): - """Spark job entry point definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SparkJobPythonEntry, SparkJobScalaEntry - - :ivar spark_job_entry_type: [Required] Type of the job's entry point. Required. Known values - are: "SparkJobPythonEntry" and "SparkJobScalaEntry". - :vartype spark_job_entry_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SparkJobEntryType - """ - - __mapping__: dict[str, _Model] = {} - spark_job_entry_type: str = rest_discriminator(name="sparkJobEntryType", visibility=["read", "create"]) - """[Required] Type of the job's entry point. Required. Known values are: \"SparkJobPythonEntry\" - and \"SparkJobScalaEntry\".""" - - @overload - def __init__( - self, - *, - spark_job_entry_type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SparkJobPythonEntry(SparkJobEntry, discriminator="SparkJobPythonEntry"): - """SparkJobPythonEntry. - - :ivar file: [Required] Relative python file path for job entry point. Required. - :vartype file: str - :ivar spark_job_entry_type: [Required] Type of the job's entry point. Required. - SPARK_JOB_PYTHON_ENTRY. - :vartype spark_job_entry_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SPARK_JOB_PYTHON_ENTRY - """ - - file: str = rest_field(visibility=["read", "create"]) - """[Required] Relative python file path for job entry point. Required.""" - spark_job_entry_type: Literal[SparkJobEntryType.SPARK_JOB_PYTHON_ENTRY] = rest_discriminator(name="sparkJobEntryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Type of the job's entry point. Required. SPARK_JOB_PYTHON_ENTRY.""" - - @overload - def __init__( - self, - *, - file: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.spark_job_entry_type = SparkJobEntryType.SPARK_JOB_PYTHON_ENTRY # type: ignore - - -class SparkJobScalaEntry(SparkJobEntry, discriminator="SparkJobScalaEntry"): - """SparkJobScalaEntry. - - :ivar class_name: [Required] Scala class name used as entry point. Required. - :vartype class_name: str - :ivar spark_job_entry_type: [Required] Type of the job's entry point. Required. - SPARK_JOB_SCALA_ENTRY. - :vartype spark_job_entry_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SPARK_JOB_SCALA_ENTRY - """ - - class_name: str = rest_field(name="className", visibility=["read", "create"]) - """[Required] Scala class name used as entry point. Required.""" - spark_job_entry_type: Literal[SparkJobEntryType.SPARK_JOB_SCALA_ENTRY] = rest_discriminator(name="sparkJobEntryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Type of the job's entry point. Required. SPARK_JOB_SCALA_ENTRY.""" - - @overload - def __init__( - self, - *, - class_name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.spark_job_entry_type = SparkJobEntryType.SPARK_JOB_SCALA_ENTRY # type: ignore - - -class SparkResourceConfiguration(_Model): - """SparkResourceConfiguration. - - :ivar instance_type: Optional type of VM used as supported by the compute target. - :vartype instance_type: str - :ivar runtime_version: Version of spark runtime used for the job. - :vartype runtime_version: str - """ - - instance_type: Optional[str] = rest_field(name="instanceType", visibility=["read", "create"]) - """Optional type of VM used as supported by the compute target.""" - runtime_version: Optional[str] = rest_field(name="runtimeVersion", visibility=["read", "create"]) - """Version of spark runtime used for the job.""" - - @overload - def __init__( - self, - *, - instance_type: Optional[str] = None, - runtime_version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SpeechEndpointDeploymentResourceProperties( - EndpointDeploymentResourceProperties, discriminator="Azure.Speech" -): # pylint: disable=name-too-long - """SpeechEndpointDeploymentResourceProperties. - - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar model: Model used for the endpoint deployment. Required. - :vartype model: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentModel - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar sku: - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CognitiveServicesSku - :ivar version_upgrade_option: Deployment model version upgrade option. Known values are: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", and "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentModelVersionUpgradeOption - :ivar type: Kind of the deployment. Required. Default value is "Azure.Speech". - :vartype type: str - """ - - model: "_models.EndpointDeploymentModel" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model used for the endpoint deployment. Required.""" - rai_policy_name: Optional[str] = rest_field( - name="raiPolicyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of RAI policy.""" - sku: Optional["_models.CognitiveServicesSku"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = rest_field( - name="versionUpgradeOption", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment model version upgrade option. Known values are: \"OnceNewDefaultVersionAvailable\", - \"OnceCurrentVersionExpired\", and \"NoAutoUpgrade\".""" - type: Literal["Azure.Speech"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Kind of the deployment. Required. Default value is \"Azure.Speech\".""" - - @overload - def __init__( - self, - *, - model: "_models.EndpointDeploymentModel", - failure_reason: Optional[str] = None, - rai_policy_name: Optional[str] = None, - sku: Optional["_models.CognitiveServicesSku"] = None, - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = "Azure.Speech" # type: ignore - - -class SpeechEndpointResourceProperties(EndpointResourceProperties, discriminator="Azure.Speech"): - """SpeechEndpointResourceProperties. - - :ivar associated_resource_id: Byo resource id for creating the built-in model service - endpoints. - :vartype associated_resource_id: str - :ivar deployments: Deployments info. - :vartype deployments: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :ivar endpoint_uri: Uri of the endpoint. - :vartype endpoint_uri: str - :ivar failure_reason: The failure reason if the creation failed. - :vartype failure_reason: str - :ivar location: Location of the endpoint. Since input dto and when parse endpoint resource - share the same contract this Location field is just for parse the endpoint resource info we - won't let customer specify the endpoint resource location since we will create it the same - location as workspace. - :vartype location: str - :ivar name: Name of the endpoint. - :vartype name: str - :ivar provisioning_state: Read-only provision state status property. Known values are: - "NotStarted", "Failed", "Creating", "Updating", "Succeeded", "Deleting", "Accepted", - "Canceled", "Scaling", and "Disabled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DefaultResourceProvisioningState - :ivar should_create_ai_services_endpoint: Whether the proxy (non-byo) endpoint is a regular - endpoint or a OneKeyV2 AI services account endpoint. - :vartype should_create_ai_services_endpoint: bool - :ivar endpoint_type: Type of the endpoint. Required. AZURE_SPEECH. - :vartype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AZURE_SPEECH - """ - - endpoint_type: Literal[EndpointType.AZURE_SPEECH] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of the endpoint. Required. AZURE_SPEECH.""" - - @overload - def __init__( - self, - *, - associated_resource_id: Optional[str] = None, - deployments: Optional[list["_models.EndpointDeploymentResourcePropertiesBasicResource"]] = None, - endpoint_uri: Optional[str] = None, - failure_reason: Optional[str] = None, - location: Optional[str] = None, - name: Optional[str] = None, - should_create_ai_services_endpoint: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.endpoint_type = EndpointType.AZURE_SPEECH # type: ignore - - -class SslConfiguration(_Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Known values are: "Disabled", "Enabled", and - "Auto". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SslConfigStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - status: Optional[Union[str, "_models.SslConfigStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Enable or disable ssl for scoring. Known values are: \"Disabled\", \"Enabled\", and \"Auto\".""" - cert: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cert data.""" - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Key data.""" - cname: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """CNAME of the cert.""" - leaf_domain_label: Optional[str] = rest_field( - name="leafDomainLabel", visibility=["read", "create", "update", "delete", "query"] - ) - """Leaf domain label of public endpoint.""" - overwrite_existing_domain: Optional[bool] = rest_field( - name="overwriteExistingDomain", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether to overwrite existing domain label.""" - - @overload - def __init__( - self, - *, - status: Optional[Union[str, "_models.SslConfigStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class StackEnsembleSettings(_Model): - """Advances setting to customize StackEnsemble run. - - :ivar stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the - meta-learner. - :vartype stack_meta_learner_k_wargs: any - :ivar stack_meta_learner_train_percentage: Specifies the proportion of the training set (when - choosing train and validation type of training) to be reserved for training the meta-learner. - Default value is 0.2. - :vartype stack_meta_learner_train_percentage: float - :ivar stack_meta_learner_type: The meta-learner is a model trained on the output of the - individual heterogeneous models.\\r\\nDefault meta-learners are LogisticRegression for - classification tasks (or LogisticRegressionCV if cross-validation is enabled) and ElasticNet - for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled).\\r\\nThis - parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, - LightGBMClassifier, ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression. Known - values are: "None", "LogisticRegression", "LogisticRegressionCV", "LightGBMClassifier", - "ElasticNet", "ElasticNetCV", "LightGBMRegressor", and "LinearRegression". - :vartype stack_meta_learner_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.StackMetaLearnerType - """ - - stack_meta_learner_k_wargs: Optional[Any] = rest_field( - name="stackMetaLearnerKWargs", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional parameters to pass to the initializer of the meta-learner.""" - stack_meta_learner_train_percentage: Optional[float] = rest_field( - name="stackMetaLearnerTrainPercentage", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the proportion of the training set (when choosing train and validation type of - training) to be reserved for training the meta-learner. Default value is 0.2.""" - stack_meta_learner_type: Optional[Union[str, "_models.StackMetaLearnerType"]] = rest_field( - name="stackMetaLearnerType", visibility=["read", "create", "update", "delete", "query"] - ) - """The meta-learner is a model trained on the output of the individual heterogeneous - models.\r\nDefault meta-learners are LogisticRegression for classification tasks (or - LogisticRegressionCV if cross-validation is enabled) and ElasticNet for regression/forecasting - tasks (or ElasticNetCV if cross-validation is enabled).\r\nThis parameter can be one of the - following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, - ElasticNetCV, LightGBMRegressor, or LinearRegression. Known values are: \"None\", - \"LogisticRegression\", \"LogisticRegressionCV\", \"LightGBMClassifier\", \"ElasticNet\", - \"ElasticNetCV\", \"LightGBMRegressor\", and \"LinearRegression\".""" - - @overload - def __init__( - self, - *, - stack_meta_learner_k_wargs: Optional[Any] = None, - stack_meta_learner_train_percentage: Optional[float] = None, - stack_meta_learner_type: Optional[Union[str, "_models.StackMetaLearnerType"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class StaticInputData(MonitoringInputDataBase, discriminator="Static"): - """Static input data definition. - - :ivar columns: Mapping of column names to special uses. - :vartype columns: dict[str, str] - :ivar data_context: The context metadata of the data source. - :vartype data_context: str - :ivar job_input_type: [Required] Specifies the type of job. Required. Known values are: - "literal", "uri_file", "uri_folder", "mltable", "custom_model", "mlflow_model", and - "triton_model". - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInputType - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar preprocessing_component_id: Reference to the component asset used to preprocess the data. - :vartype preprocessing_component_id: str - :ivar window_end: [Required] The end date of the data window. Required. - :vartype window_end: ~datetime.datetime - :ivar window_start: [Required] The start date of the data window. Required. - :vartype window_start: ~datetime.datetime - :ivar input_data_type: [Required] Specifies the type of signal to monitor. Required. An input - data with a fixed window size. - :vartype input_data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.STATIC - """ - - preprocessing_component_id: Optional[str] = rest_field( - name="preprocessingComponentId", visibility=["read", "create"] - ) - """Reference to the component asset used to preprocess the data.""" - window_end: datetime.datetime = rest_field(name="windowEnd", visibility=["read", "create"], format="rfc3339") - """[Required] The end date of the data window. Required.""" - window_start: datetime.datetime = rest_field(name="windowStart", visibility=["read", "create"], format="rfc3339") - """[Required] The start date of the data window. Required.""" - input_data_type: Literal[MonitoringInputDataType.STATIC] = rest_discriminator(name="inputDataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of signal to monitor. Required. An input data with a fixed window - size.""" - - @overload - def __init__( - self, - *, - job_input_type: Union[str, "_models.JobInputType"], - uri: str, - window_end: datetime.datetime, - window_start: datetime.datetime, - columns: Optional[dict[str, str]] = None, - data_context: Optional[str] = None, - preprocessing_component_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.input_data_type = MonitoringInputDataType.STATIC # type: ignore - - -class StorageAccountDetails(_Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: Details of system created storage account to be used for - the registry. - :vartype system_created_storage_account: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemCreatedStorageAccount - """ - - system_created_storage_account: Optional["_models.SystemCreatedStorageAccount"] = rest_field( - name="systemCreatedStorageAccount", visibility=["read", "create", "update", "delete", "query"] - ) - """Details of system created storage account to be used for the registry.""" - - @overload - def __init__( - self, - *, - system_created_storage_account: Optional["_models.SystemCreatedStorageAccount"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class StringStringKeyValuePair(_Model): - """StringStringKeyValuePair. - - :ivar key: - :vartype key: str - :ivar value: - :vartype value: str - """ - - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - key: Optional[str] = None, - value: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SweepJob(JobBaseProperties, discriminator="Sweep"): - """Sweep job definition. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. Defaults to AmlToken if null. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotificationSetting - :ivar parent_job_name: Parent job name. - :vartype parent_job_name: str - :ivar services: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint - value of FileStreamObject. - :vartype services: dict[str, - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobService] - :ivar status: Status of the job. Known values are: "NotStarted", "Starting", "Provisioning", - "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", "Failed", - "Canceled", "NotResponding", "Paused", and "Unknown". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobStatus - :ivar early_termination: Early termination policies enable canceling poor-performing runs - before they complete. - :vartype early_termination: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EarlyTerminationPolicy - :ivar inputs: Mapping of input data bindings used in the job. - :vartype inputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobInput] - :ivar limits: Sweep Job limit. - :vartype limits: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SweepJobLimits - :ivar objective: [Required] Optimization objective. Required. - :vartype objective: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Objective - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QueueSettings - :ivar sampling_algorithm: [Required] The hyperparameter sampling algorithm. Required. - :vartype sampling_algorithm: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SamplingAlgorithm - :ivar search_space: [Required] A dictionary containing each parameter and its distribution. The - dictionary key is the name of the parameter. Required. - :vartype search_space: any - :ivar trial: [Required] Trial component definition. Required. - :vartype trial: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TrialComponent - :ivar job_type: [Required] Specifies the type of job. Required. SWEEP. - :vartype job_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SWEEP - """ - - early_termination: Optional["_models.EarlyTerminationPolicy"] = rest_field( - name="earlyTermination", visibility=["read", "create", "update", "delete", "query"] - ) - """Early termination policies enable canceling poor-performing runs before they complete.""" - inputs: Optional[dict[str, "_models.JobInput"]] = rest_field(visibility=["read", "create"]) - """Mapping of input data bindings used in the job.""" - limits: Optional["_models.SweepJobLimits"] = rest_field(visibility=["read", "create"]) - """Sweep Job limit.""" - objective: "_models.Objective" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Optimization objective. Required.""" - outputs: Optional[dict[str, "_models.JobOutput"]] = rest_field(visibility=["read", "create"]) - """Mapping of output data bindings used in the job.""" - queue_settings: Optional["_models.QueueSettings"] = rest_field(name="queueSettings", visibility=["read", "create"]) - """Queue settings for the job.""" - sampling_algorithm: "_models.SamplingAlgorithm" = rest_field( - name="samplingAlgorithm", visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] The hyperparameter sampling algorithm. Required.""" - search_space: Any = rest_field(name="searchSpace", visibility=["read", "create", "update", "delete", "query"]) - """[Required] A dictionary containing each parameter and its distribution. The dictionary key is - the name of the parameter. Required.""" - trial: "_models.TrialComponent" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Trial component definition. Required.""" - job_type: Literal[JobType.SWEEP] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. SWEEP.""" - - @overload - def __init__( - self, - *, - objective: "_models.Objective", - sampling_algorithm: "_models.SamplingAlgorithm", - search_space: Any, - trial: "_models.TrialComponent", - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - component_id: Optional[str] = None, - compute_id: Optional[str] = None, - display_name: Optional[str] = None, - experiment_name: Optional[str] = None, - identity: Optional["_models.IdentityConfiguration"] = None, - is_archived: Optional[bool] = None, - notification_setting: Optional["_models.NotificationSetting"] = None, - parent_job_name: Optional[str] = None, - services: Optional[dict[str, "_models.JobService"]] = None, - early_termination: Optional["_models.EarlyTerminationPolicy"] = None, - inputs: Optional[dict[str, "_models.JobInput"]] = None, - limits: Optional["_models.SweepJobLimits"] = None, - outputs: Optional[dict[str, "_models.JobOutput"]] = None, - queue_settings: Optional["_models.QueueSettings"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = JobType.SWEEP # type: ignore - - -class SweepJobLimits(JobLimits, discriminator="Sweep"): - """Sweep Job limit class. - - :ivar timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. - Only supports duration with precision as low as Seconds. - :vartype timeout: ~datetime.timedelta - :ivar max_concurrent_trials: Sweep Job max concurrent trials. - :vartype max_concurrent_trials: int - :ivar max_total_trials: Sweep Job max total trials. - :vartype max_total_trials: int - :ivar trial_timeout: Sweep Job Trial timeout value. - :vartype trial_timeout: ~datetime.timedelta - :ivar job_limits_type: [Required] JobLimit type. Required. SWEEP. - :vartype job_limits_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SWEEP - """ - - max_concurrent_trials: Optional[int] = rest_field( - name="maxConcurrentTrials", visibility=["read", "create", "update", "delete", "query"] - ) - """Sweep Job max concurrent trials.""" - max_total_trials: Optional[int] = rest_field( - name="maxTotalTrials", visibility=["read", "create", "update", "delete", "query"] - ) - """Sweep Job max total trials.""" - trial_timeout: Optional[datetime.timedelta] = rest_field( - name="trialTimeout", visibility=["read", "create", "update", "delete", "query"] - ) - """Sweep Job Trial timeout value.""" - job_limits_type: Literal[JobLimitsType.SWEEP] = rest_discriminator(name="jobLimitsType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] JobLimit type. Required. SWEEP.""" - - @overload - def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - max_concurrent_trials: Optional[int] = None, - max_total_trials: Optional[int] = None, - trial_timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_limits_type = JobLimitsType.SWEEP # type: ignore - - -class SynapseSpark(Compute, discriminator="SynapseSpark"): - """A SynapseSpark compute. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SynapseSparkProperties - :ivar compute_type: The type of compute. Required. SYNAPSE_SPARK. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SYNAPSE_SPARK - """ - - properties: Optional["_models.SynapseSparkProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - compute_type: Literal[ComputeType.SYNAPSE_SPARK] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. SYNAPSE_SPARK.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.SynapseSparkProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.SYNAPSE_SPARK # type: ignore - - -class SynapseSparkProperties(_Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - auto_scale_properties: Optional["_models.AutoScaleProperties"] = rest_field( - name="autoScaleProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Auto scale properties.""" - auto_pause_properties: Optional["_models.AutoPauseProperties"] = rest_field( - name="autoPauseProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Auto pause properties.""" - spark_version: Optional[str] = rest_field( - name="sparkVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Spark version.""" - node_count: Optional[int] = rest_field(name="nodeCount", visibility=["read", "create", "update", "delete", "query"]) - """The number of compute nodes currently assigned to the compute.""" - node_size: Optional[str] = rest_field(name="nodeSize", visibility=["read", "create", "update", "delete", "query"]) - """Node size.""" - node_size_family: Optional[str] = rest_field( - name="nodeSizeFamily", visibility=["read", "create", "update", "delete", "query"] - ) - """Node size family.""" - subscription_id: Optional[str] = rest_field( - name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure subscription identifier.""" - resource_group: Optional[str] = rest_field( - name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the resource group in which workspace is located.""" - workspace_name: Optional[str] = rest_field( - name="workspaceName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of Azure Machine Learning workspace.""" - pool_name: Optional[str] = rest_field(name="poolName", visibility=["read", "create", "update", "delete", "query"]) - """Pool name.""" - - @overload - def __init__( - self, - *, - auto_scale_properties: Optional["_models.AutoScaleProperties"] = None, - auto_pause_properties: Optional["_models.AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SystemCreatedAcrAccount(_Model): - """SystemCreatedAcrAccount. - - :ivar acr_account_name: Name of the ACR account. - :vartype acr_account_name: str - :ivar acr_account_sku: SKU of the ACR account. - :vartype acr_account_sku: str - :ivar arm_resource_id: This is populated once the ACR account is created. - :vartype arm_resource_id: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ArmResourceId - """ - - acr_account_name: Optional[str] = rest_field( - name="acrAccountName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the ACR account.""" - acr_account_sku: Optional[str] = rest_field( - name="acrAccountSku", visibility=["read", "create", "update", "delete", "query"] - ) - """SKU of the ACR account.""" - arm_resource_id: Optional["_models.ArmResourceId"] = rest_field( - name="armResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """This is populated once the ACR account is created.""" - - @overload - def __init__( - self, - *, - acr_account_name: Optional[str] = None, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["_models.ArmResourceId"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SystemCreatedStorageAccount(_Model): - """SystemCreatedStorageAccount. - - :ivar allow_blob_public_access: Public blob access allowed. - :vartype allow_blob_public_access: bool - :ivar arm_resource_id: This is populated once the storage account is created. - :vartype arm_resource_id: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ArmResourceId - :ivar storage_account_hns_enabled: HNS enabled for storage account. - :vartype storage_account_hns_enabled: bool - :ivar storage_account_name: Name of the storage account. - :vartype storage_account_name: str - :ivar storage_account_type: Allowed values: "Standard_LRS", "Standard_GRS", "Standard_RAGRS", - "Standard_ZRS", "Standard_GZRS", "Standard_RAGZRS", "Premium_LRS", "Premium_ZRS". - :vartype storage_account_type: str - """ - - allow_blob_public_access: Optional[bool] = rest_field( - name="allowBlobPublicAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Public blob access allowed.""" - arm_resource_id: Optional["_models.ArmResourceId"] = rest_field( - name="armResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """This is populated once the storage account is created.""" - storage_account_hns_enabled: Optional[bool] = rest_field( - name="storageAccountHnsEnabled", visibility=["read", "create", "update", "delete", "query"] - ) - """HNS enabled for storage account.""" - storage_account_name: Optional[str] = rest_field( - name="storageAccountName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the storage account.""" - storage_account_type: Optional[str] = rest_field( - name="storageAccountType", visibility=["read", "create", "update", "delete", "query"] - ) - """Allowed values: \"Standard_LRS\", \"Standard_GRS\", \"Standard_RAGRS\", \"Standard_ZRS\", - \"Standard_GZRS\", \"Standard_RAGZRS\", \"Premium_LRS\", \"Premium_ZRS\".""" - - @overload - def __init__( - self, - *, - allow_blob_public_access: Optional[bool] = None, - arm_resource_id: Optional["_models.ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_name: Optional[str] = None, - storage_account_type: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SystemData(_Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) - """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( - name="createdByType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of identity that created the resource. Known values are: \"User\", \"Application\", - \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field( - name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field( - name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] - ) - """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( - name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of identity that last modified the resource. Known values are: \"User\", - \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field( - name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp of resource last modification (UTC).""" - - @overload - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SystemService(_Model): - """A system service running on a compute. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - system_service_type: Optional[str] = rest_field(name="systemServiceType", visibility=["read"]) - """The type of this system service.""" - public_ip_address: Optional[str] = rest_field(name="publicIpAddress", visibility=["read"]) - """Public IP address.""" - version: Optional[str] = rest_field(visibility=["read"]) - """The version for this type.""" - - -class TableVerticalFeaturizationSettings(FeaturizationSettings): - """Featurization Configuration. - - :ivar dataset_language: Dataset language, useful for the text data. - :vartype dataset_language: str - :ivar blocked_transformers: These transformers shall not be used in featurization. - :vartype blocked_transformers: list[str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BlockedTransformers] - :ivar column_name_and_types: Dictionary of column name and its type (int, float, string, - datetime etc). - :vartype column_name_and_types: dict[str, str] - :ivar enable_dnn_featurization: Determines whether to use Dnn based featurizers for data - featurization. - :vartype enable_dnn_featurization: bool - :ivar mode: Featurization mode - User can keep the default 'Auto' mode and AutoML will take - care of necessary transformation of the data in featurization phase. If 'Off' is selected then - no featurization is done. If 'Custom' is selected then user can specify additional inputs to - customize how featurization is done. Known values are: "Auto", "Custom", and "Off". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturizationMode - :ivar transformer_params: User can specify additional transformers to be used along with the - columns to which it would be applied and parameters for the transformer constructor. - :vartype transformer_params: dict[str, - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ColumnTransformer]] - """ - - blocked_transformers: Optional[list[Union[str, "_models.BlockedTransformers"]]] = rest_field( - name="blockedTransformers", visibility=["read", "create", "update", "delete", "query"] - ) - """These transformers shall not be used in featurization.""" - column_name_and_types: Optional[dict[str, str]] = rest_field( - name="columnNameAndTypes", visibility=["read", "create", "update", "delete", "query"] - ) - """Dictionary of column name and its type (int, float, string, datetime etc).""" - enable_dnn_featurization: Optional[bool] = rest_field( - name="enableDnnFeaturization", visibility=["read", "create", "update", "delete", "query"] - ) - """Determines whether to use Dnn based featurizers for data featurization.""" - mode: Optional[Union[str, "_models.FeaturizationMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Featurization mode - User can keep the default 'Auto' mode and AutoML will take care of - necessary transformation of the data in featurization phase. If 'Off' is selected then no - featurization is done. If 'Custom' is selected then user can specify additional inputs to - customize how featurization is done. Known values are: \"Auto\", \"Custom\", and \"Off\".""" - transformer_params: Optional[dict[str, list["_models.ColumnTransformer"]]] = rest_field( - name="transformerParams", visibility=["read", "create", "update", "delete", "query"] - ) - """User can specify additional transformers to be used along with the columns to which it would be - applied and parameters for the transformer constructor.""" - - @overload - def __init__( - self, - *, - dataset_language: Optional[str] = None, - blocked_transformers: Optional[list[Union[str, "_models.BlockedTransformers"]]] = None, - column_name_and_types: Optional[dict[str, str]] = None, - enable_dnn_featurization: Optional[bool] = None, - mode: Optional[Union[str, "_models.FeaturizationMode"]] = None, - transformer_params: Optional[dict[str, list["_models.ColumnTransformer"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TableVerticalLimitSettings(_Model): - """Job execution constraints. - - :ivar enable_early_termination: Enable early termination, determines whether or not if - AutoMLJob will terminate early if there is no score improvement in last 20 iterations. - :vartype enable_early_termination: bool - :ivar exit_score: Exit score for the AutoML job. - :vartype exit_score: float - :ivar max_concurrent_trials: Maximum Concurrent iterations. - :vartype max_concurrent_trials: int - :ivar max_cores_per_trial: Max cores per iteration. - :vartype max_cores_per_trial: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Iteration timeout. - :vartype trial_timeout: ~datetime.timedelta - """ - - enable_early_termination: Optional[bool] = rest_field( - name="enableEarlyTermination", visibility=["read", "create", "update", "delete", "query"] - ) - """Enable early termination, determines whether or not if AutoMLJob will terminate early if there - is no score improvement in last 20 iterations.""" - exit_score: Optional[float] = rest_field( - name="exitScore", visibility=["read", "create", "update", "delete", "query"] - ) - """Exit score for the AutoML job.""" - max_concurrent_trials: Optional[int] = rest_field( - name="maxConcurrentTrials", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum Concurrent iterations.""" - max_cores_per_trial: Optional[int] = rest_field( - name="maxCoresPerTrial", visibility=["read", "create", "update", "delete", "query"] - ) - """Max cores per iteration.""" - max_trials: Optional[int] = rest_field(name="maxTrials", visibility=["read", "create", "update", "delete", "query"]) - """Number of iterations.""" - timeout: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """AutoML job timeout.""" - trial_timeout: Optional[datetime.timedelta] = rest_field( - name="trialTimeout", visibility=["read", "create", "update", "delete", "query"] - ) - """Iteration timeout.""" - - @overload - def __init__( - self, - *, - enable_early_termination: Optional[bool] = None, - exit_score: Optional[float] = None, - max_concurrent_trials: Optional[int] = None, - max_cores_per_trial: Optional[int] = None, - max_trials: Optional[int] = None, - timeout: Optional[datetime.timedelta] = None, - trial_timeout: Optional[datetime.timedelta] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TargetUtilizationScaleSettings(OnlineScaleSettings, discriminator="TargetUtilization"): - """TargetUtilizationScaleSettings. - - :ivar max_instances: The maximum number of instances that the deployment can scale to. The - quota will be reserved for max_instances. - :vartype max_instances: int - :ivar min_instances: The minimum number of instances to always be present. - :vartype min_instances: int - :ivar polling_interval: The polling interval in ISO 8691 format. Only supports duration with - precision as low as Seconds. - :vartype polling_interval: ~datetime.timedelta - :ivar target_utilization_percentage: Target CPU usage for the autoscaler. - :vartype target_utilization_percentage: int - :ivar scale_type: [Required] Type of deployment scaling algorithm. Required. - TARGET_UTILIZATION. - :vartype scale_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TARGET_UTILIZATION - """ - - max_instances: Optional[int] = rest_field( - name="maxInstances", visibility=["read", "create", "update", "delete", "query"] - ) - """The maximum number of instances that the deployment can scale to. The quota will be reserved - for max_instances.""" - min_instances: Optional[int] = rest_field( - name="minInstances", visibility=["read", "create", "update", "delete", "query"] - ) - """The minimum number of instances to always be present.""" - polling_interval: Optional[datetime.timedelta] = rest_field( - name="pollingInterval", visibility=["read", "create", "update", "delete", "query"] - ) - """The polling interval in ISO 8691 format. Only supports duration with precision as low as - Seconds.""" - target_utilization_percentage: Optional[int] = rest_field( - name="targetUtilizationPercentage", visibility=["read", "create", "update", "delete", "query"] - ) - """Target CPU usage for the autoscaler.""" - scale_type: Literal[ScaleType.TARGET_UTILIZATION] = rest_discriminator(name="scaleType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Type of deployment scaling algorithm. Required. TARGET_UTILIZATION.""" - - @overload - def __init__( - self, - *, - max_instances: Optional[int] = None, - min_instances: Optional[int] = None, - polling_interval: Optional[datetime.timedelta] = None, - target_utilization_percentage: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.scale_type = ScaleType.TARGET_UTILIZATION # type: ignore - - -class TeacherModelEndpoint(_Model): - """TeacherModelEndpoint. - - :ivar endpoint_name: - :vartype endpoint_name: str - """ - - endpoint_name: Optional[str] = rest_field( - name="endpointName", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - endpoint_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TeacherModelEndpointRequestSettings(_Model): - """TeacherModelEndpointRequestSettings. - - :ivar min_endpoint_success_ratio: - :vartype min_endpoint_success_ratio: float - :ivar request_batch_size: - :vartype request_batch_size: int - """ - - min_endpoint_success_ratio: Optional[float] = rest_field( - name="minEndpointSuccessRatio", visibility=["read", "create", "update", "delete", "query"] - ) - request_batch_size: Optional[int] = rest_field( - name="requestBatchSize", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - min_endpoint_success_ratio: Optional[float] = None, - request_batch_size: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TeacherModelSettings(_Model): - """TeacherModelSettings. - - :ivar teacher_model_endpoint_request_settings: Teacher Model Request Settings. - :vartype teacher_model_endpoint_request_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TeacherModelEndpointRequestSettings - :ivar teacher_model_inference_parameters: Teacher Model Inference Settings. - :vartype teacher_model_inference_parameters: dict[str, str] - """ - - teacher_model_endpoint_request_settings: Optional["_models.TeacherModelEndpointRequestSettings"] = rest_field( - name="teacherModelEndpointRequestSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Teacher Model Request Settings.""" - teacher_model_inference_parameters: Optional[dict[str, str]] = rest_field( - name="teacherModelInferenceParameters", visibility=["read", "create", "update", "delete", "query"] - ) - """Teacher Model Inference Settings.""" - - @overload - def __init__( - self, - *, - teacher_model_endpoint_request_settings: Optional["_models.TeacherModelEndpointRequestSettings"] = None, - teacher_model_inference_parameters: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TensorFlow(DistributionConfiguration, discriminator="TensorFlow"): - """TensorFlow distribution configuration. - - :ivar parameter_server_count: Number of parameter server tasks. - :vartype parameter_server_count: int - :ivar worker_count: Number of workers. If not specified, will default to the instance count. - :vartype worker_count: int - :ivar distribution_type: [Required] Specifies the type of distribution framework. Required. - TENSOR_FLOW. - :vartype distribution_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TENSOR_FLOW - """ - - parameter_server_count: Optional[int] = rest_field(name="parameterServerCount", visibility=["read", "create"]) - """Number of parameter server tasks.""" - worker_count: Optional[int] = rest_field(name="workerCount", visibility=["read", "create"]) - """Number of workers. If not specified, will default to the instance count.""" - distribution_type: Literal[DistributionType.TENSOR_FLOW] = rest_discriminator(name="distributionType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of distribution framework. Required. TENSOR_FLOW.""" - - @overload - def __init__( - self, - *, - parameter_server_count: Optional[int] = None, - worker_count: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.distribution_type = DistributionType.TENSOR_FLOW # type: ignore - - -class TextClassification(AutoMLVertical, discriminator="TextClassification"): - """Text Classification task in AutoML NLP vertical. NLP - Natural Language Processing. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar primary_metric: Primary metrics for classification tasks. Known values are: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", and - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationPrimaryMetrics - :ivar task_type: [Required] Task type for AutoMLJob. Required. Text classification (also known - as text tagging or text categorization) is the process of sorting texts into categories. - Categories are mutually exclusive. - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TEXT_CLASSIFICATION - """ - - featurization_settings: Optional["_models.NlpVerticalFeaturizationSettings"] = rest_field( - name="featurizationSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Featurization inputs needed for AutoML job.""" - limit_settings: Optional["_models.NlpVerticalLimitSettings"] = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Execution constraints for AutoMLJob.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - primary_metric: Optional[Union[str, "_models.ClassificationPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary metrics for classification tasks. Known values are: \"AUCWeighted\", \"Accuracy\", - \"NormMacroRecall\", \"AveragePrecisionScoreWeighted\", and \"PrecisionScoreWeighted\".""" - task_type: Literal[TaskType.TEXT_CLASSIFICATION] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Text classification (also known as text tagging - or text categorization) is the process of sorting texts into categories. Categories are - mutually exclusive.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - featurization_settings: Optional["_models.NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["_models.NlpVerticalLimitSettings"] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - primary_metric: Optional[Union[str, "_models.ClassificationPrimaryMetrics"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.TEXT_CLASSIFICATION # type: ignore - - -class TextClassificationMultilabel(AutoMLVertical, discriminator="TextClassificationMultilabel"): - """Text Classification Multilabel task in AutoML NLP vertical. NLP - Natural Language Processing. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. Currently only - Accuracy is supported as primary metric, hence user need not set it explicitly. Known values - are: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", and "IOU". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationMultilabelPrimaryMetrics - :ivar task_type: [Required] Task type for AutoMLJob. Required. Multilabel classification task - assigns each sample to a group (zero or more) of target labels. - :vartype task_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TEXT_CLASSIFICATION_MULTILABEL - """ - - featurization_settings: Optional["_models.NlpVerticalFeaturizationSettings"] = rest_field( - name="featurizationSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Featurization inputs needed for AutoML job.""" - limit_settings: Optional["_models.NlpVerticalLimitSettings"] = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Execution constraints for AutoMLJob.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - primary_metric: Optional[Union[str, "_models.ClassificationMultilabelPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read"] - ) - """Primary metric for Text-Classification-Multilabel task. Currently only Accuracy is supported as - primary metric, hence user need not set it explicitly. Known values are: \"AUCWeighted\", - \"Accuracy\", \"NormMacroRecall\", \"AveragePrecisionScoreWeighted\", - \"PrecisionScoreWeighted\", and \"IOU\".""" - task_type: Literal[TaskType.TEXT_CLASSIFICATION_MULTILABEL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Multilabel classification task assigns each - sample to a group (zero or more) of target labels.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - featurization_settings: Optional["_models.NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["_models.NlpVerticalLimitSettings"] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.TEXT_CLASSIFICATION_MULTILABEL # type: ignore - - -class TextNer(AutoMLVertical, discriminator="TextNER"): - """Text-NER task in AutoML NLP vertical. NER - Named Entity Recognition. NLP - Natural Language - Processing. - - :ivar log_verbosity: Enum for setting log verbosity. Known values are: "NotSet", "Debug", - "Info", "Warning", "Error", and "Critical". - :vartype log_verbosity: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. Also known as - label column name in context of classification tasks. - :vartype target_column_name: str - :ivar training_data: [Required] Training data input. Required. - :vartype training_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. Only 'Accuracy' is supported for - Text-NER, so user need not set this explicitly. Known values are: "AUCWeighted", "Accuracy", - "NormMacroRecall", "AveragePrecisionScoreWeighted", and "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClassificationPrimaryMetrics - :ivar task_type: [Required] Task type for AutoMLJob. Required. Text Named Entity Recognition - a.k.a. TextNER. Named Entity Recognition (NER) is the ability to take free-form text and - identify the occurrences of entities such as people, locations, organizations, and more. - :vartype task_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TEXT_NER - """ - - featurization_settings: Optional["_models.NlpVerticalFeaturizationSettings"] = rest_field( - name="featurizationSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Featurization inputs needed for AutoML job.""" - limit_settings: Optional["_models.NlpVerticalLimitSettings"] = rest_field( - name="limitSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Execution constraints for AutoMLJob.""" - validation_data: Optional["_models.MLTableJobInput"] = rest_field( - name="validationData", visibility=["read", "create", "update", "delete", "query"] - ) - """Validation data inputs.""" - primary_metric: Optional[Union[str, "_models.ClassificationPrimaryMetrics"]] = rest_field( - name="primaryMetric", visibility=["read"] - ) - """Primary metric for Text-NER task. Only 'Accuracy' is supported for Text-NER, so user need not - set this explicitly. Known values are: \"AUCWeighted\", \"Accuracy\", \"NormMacroRecall\", - \"AveragePrecisionScoreWeighted\", and \"PrecisionScoreWeighted\".""" - task_type: Literal[TaskType.TEXT_NER] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Task type for AutoMLJob. Required. Text Named Entity Recognition a.k.a. TextNER. - Named Entity Recognition (NER) is the ability to take free-form text and identify the - occurrences of entities such as people, locations, organizations, and more.""" - - @overload - def __init__( - self, - *, - training_data: "_models.MLTableJobInput", - log_verbosity: Optional[Union[str, "_models.LogVerbosity"]] = None, - target_column_name: Optional[str] = None, - featurization_settings: Optional["_models.NlpVerticalFeaturizationSettings"] = None, - limit_settings: Optional["_models.NlpVerticalLimitSettings"] = None, - validation_data: Optional["_models.MLTableJobInput"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.task_type = TaskType.TEXT_NER # type: ignore - - -class TmpfsOptions(_Model): - """TmpfsOptions. - - :ivar size: Mention the Tmpfs size. - :vartype size: int - """ - - size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Mention the Tmpfs size.""" - - @overload - def __init__( - self, - *, - size: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TopNFeaturesByAttribution(MonitoringFeatureFilterBase, discriminator="TopNByAttribution"): - """TopNFeaturesByAttribution. - - :ivar top: The number of top features to include. - :vartype top: int - :ivar filter_type: [Required] Specifies the feature filter to leverage when selecting features - to calculate metrics over. Required. Only includes the top contributing features, measured by - feature attribution. - :vartype filter_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TOP_N_BY_ATTRIBUTION - """ - - top: Optional[int] = rest_field(visibility=["read", "create"]) - """The number of top features to include.""" - filter_type: Literal[MonitoringFeatureFilterType.TOP_N_BY_ATTRIBUTION] = rest_discriminator(name="filterType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the feature filter to leverage when selecting features to calculate - metrics over. Required. Only includes the top contributing features, measured by feature - attribution.""" - - @overload - def __init__( - self, - *, - top: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.filter_type = MonitoringFeatureFilterType.TOP_N_BY_ATTRIBUTION # type: ignore - - -class TrialComponent(_Model): - """Trial component definition. - - :ivar code_id: ARM resource ID of the code asset. - :vartype code_id: str - :ivar command: [Required] The command to execute on startup of the job. eg. "python train.py". - Required. - :vartype command: str - :ivar distribution: Distribution configuration of the job. If set, this should be one of Mpi, - Tensorflow, PyTorch, or null. - :vartype distribution: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DistributionConfiguration - :ivar environment_id: [Required] The ARM resource ID of the Environment specification for the - job. Required. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobResourceConfiguration - """ - - code_id: Optional[str] = rest_field(name="codeId", visibility=["read", "create"]) - """ARM resource ID of the code asset.""" - command: str = rest_field(visibility=["read", "create"]) - """[Required] The command to execute on startup of the job. eg. \"python train.py\". Required.""" - distribution: Optional["_models.DistributionConfiguration"] = rest_field(visibility=["read", "create"]) - """Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, - or null.""" - environment_id: str = rest_field(name="environmentId", visibility=["read", "create", "update", "delete", "query"]) - """[Required] The ARM resource ID of the Environment specification for the job. Required.""" - environment_variables: Optional[dict[str, str]] = rest_field( - name="environmentVariables", visibility=["read", "create"] - ) - """Environment variables included in the job.""" - resources: Optional["_models.JobResourceConfiguration"] = rest_field(visibility=["read", "create"]) - """Compute Resource configuration for the job.""" - - @overload - def __init__( - self, - *, - command: str, - environment_id: str, - code_id: Optional[str] = None, - distribution: Optional["_models.DistributionConfiguration"] = None, - environment_variables: Optional[dict[str, str]] = None, - resources: Optional["_models.JobResourceConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TritonModelJobInput(JobInput, discriminator="triton_model"): - """TritonModelJobInput. - - :ivar description: Description for the input. - :vartype description: str - :ivar mode: Enum to determine the input data delivery mode. Known values are: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", and "EvalDownload". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InputDeliveryMode - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar job_input_type: [Required] Specifies the type of job. Required. TRITON_MODEL. - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TRITON_MODEL - """ - - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Enum to determine the input data delivery mode. Known values are: \"ReadOnlyMount\", - \"ReadWriteMount\", \"Download\", \"Direct\", \"EvalMount\", and \"EvalDownload\".""" - uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Input Asset URI. Required.""" - job_input_type: Literal[JobInputType.TRITON_MODEL] = rest_discriminator(name="jobInputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. TRITON_MODEL.""" - - @overload - def __init__( - self, - *, - uri: str, - description: Optional[str] = None, - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_input_type = JobInputType.TRITON_MODEL # type: ignore - - -class TritonModelJobOutput(JobOutput, discriminator="triton_model"): - """TritonModelJobOutput. - - :ivar description: Description for the output. - :vartype description: str - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output data delivery mode enums. Known values are: "ReadWriteMount", "Upload", and - "Direct". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar job_output_type: [Required] Specifies the type of job. Required. TRITON_MODEL. - :vartype job_output_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TRITON_MODEL - """ - - asset_name: Optional[str] = rest_field(name="assetName", visibility=["read", "create", "update", "delete", "query"]) - """Output Asset Name.""" - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Output data delivery mode enums. Known values are: \"ReadWriteMount\", \"Upload\", and - \"Direct\".""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Output Asset URI.""" - job_output_type: Literal[JobOutputType.TRITON_MODEL] = rest_discriminator(name="jobOutputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. TRITON_MODEL.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_output_type = JobOutputType.TRITON_MODEL # type: ignore - - -class TruncationSelectionPolicy(EarlyTerminationPolicy, discriminator="TruncationSelection"): - """Defines an early termination policy that cancels a given percentage of runs at each evaluation - interval. - - :ivar delay_evaluation: Number of intervals by which to delay the first evaluation. - :vartype delay_evaluation: int - :ivar evaluation_interval: Interval (number of runs) between policy evaluations. - :vartype evaluation_interval: int - :ivar truncation_percentage: The percentage of runs to cancel at each evaluation interval. - :vartype truncation_percentage: int - :ivar policy_type: [Required] Name of policy configuration. Required. TRUNCATION_SELECTION. - :vartype policy_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TRUNCATION_SELECTION - """ - - truncation_percentage: Optional[int] = rest_field( - name="truncationPercentage", visibility=["read", "create", "update", "delete", "query"] - ) - """The percentage of runs to cancel at each evaluation interval.""" - policy_type: Literal[EarlyTerminationPolicyType.TRUNCATION_SELECTION] = rest_discriminator(name="policyType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Name of policy configuration. Required. TRUNCATION_SELECTION.""" - - @overload - def __init__( - self, - *, - delay_evaluation: Optional[int] = None, - evaluation_interval: Optional[int] = None, - truncation_percentage: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.policy_type = EarlyTerminationPolicyType.TRUNCATION_SELECTION # type: ignore - - -class UpdateWorkspaceQuotas(_Model): - """The properties for update Quota response. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: Limit. - :vartype limit: int - :ivar unit: An enum describing the unit of quota measurement. "Count" - :vartype unit: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaUnit - :ivar status: Update Workspace Quota Status. Known values are: "Undefined", "Success", - "Failure", "InvalidQuotaBelowClusterMinimum", "InvalidQuotaExceedsSubscriptionLimit", - "InvalidVMFamilyName", "OperationNotSupportedForSku", and "OperationNotEnabledForRegion". - :vartype status: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Status - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Specifies the resource ID.""" - type: Optional[str] = rest_field(visibility=["read"]) - """Specifies the resource type.""" - limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Limit.""" - unit: Optional[Union[str, "_models.QuotaUnit"]] = rest_field(visibility=["read"]) - """An enum describing the unit of quota measurement. \"Count\"""" - status: Optional[Union[str, "_models.Status"]] = rest_field(visibility=["read"]) - """Update Workspace Quota Status. Known values are: \"Undefined\", \"Success\", \"Failure\", - \"InvalidQuotaBelowClusterMinimum\", \"InvalidQuotaExceedsSubscriptionLimit\", - \"InvalidVMFamilyName\", \"OperationNotSupportedForSku\", and \"OperationNotEnabledForRegion\".""" - - @overload - def __init__( - self, - *, - limit: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateWorkspaceQuotasResult(_Model): - """The result of update workspace quota. - - :ivar value: The list of workspace quota update result. - :vartype value: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - value: Optional[list["_models.UpdateWorkspaceQuotas"]] = rest_field(visibility=["read"]) - """The list of workspace quota update result.""" - next_link: Optional[str] = rest_field(name="nextLink", visibility=["read"]) - """The URI to fetch the next page of workspace quota update result. Call ListNext() with this to - fetch the next page of Workspace Quota update result.""" - - -class UriFileDataVersion(DataVersionBaseProperties, discriminator="uri_file"): - """uri-file data version entity. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_uri: [Required] Uri of the data. Example: - `https://go.microsoft.com/fwlink/?linkid=2202330 - `_. Required. - :vartype data_uri: str - :ivar data_type: [Required] Specifies the type of data. Required. URI_FILE. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.URI_FILE - """ - - data_type: Literal[DataType.URI_FILE] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of data. Required. URI_FILE.""" - - @overload - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = DataType.URI_FILE # type: ignore - - -class UriFileJobInput(JobInput, discriminator="uri_file"): - """UriFileJobInput. - - :ivar description: Description for the input. - :vartype description: str - :ivar mode: Enum to determine the input data delivery mode. Known values are: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", and "EvalDownload". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InputDeliveryMode - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar job_input_type: [Required] Specifies the type of job. Required. URI_FILE. - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.URI_FILE - """ - - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Enum to determine the input data delivery mode. Known values are: \"ReadOnlyMount\", - \"ReadWriteMount\", \"Download\", \"Direct\", \"EvalMount\", and \"EvalDownload\".""" - uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Input Asset URI. Required.""" - job_input_type: Literal[JobInputType.URI_FILE] = rest_discriminator(name="jobInputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. URI_FILE.""" - - @overload - def __init__( - self, - *, - uri: str, - description: Optional[str] = None, - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_input_type = JobInputType.URI_FILE # type: ignore - - -class UriFileJobOutput(JobOutput, discriminator="uri_file"): - """UriFileJobOutput. - - :ivar description: Description for the output. - :vartype description: str - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output data delivery mode enums. Known values are: "ReadWriteMount", "Upload", and - "Direct". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar job_output_type: [Required] Specifies the type of job. Required. URI_FILE. - :vartype job_output_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.URI_FILE - """ - - asset_name: Optional[str] = rest_field(name="assetName", visibility=["read", "create", "update", "delete", "query"]) - """Output Asset Name.""" - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Output data delivery mode enums. Known values are: \"ReadWriteMount\", \"Upload\", and - \"Direct\".""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Output Asset URI.""" - job_output_type: Literal[JobOutputType.URI_FILE] = rest_discriminator(name="jobOutputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. URI_FILE.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_output_type = JobOutputType.URI_FILE # type: ignore - - -class UriFolderDataVersion(DataVersionBaseProperties, discriminator="uri_folder"): - """uri-folder data version entity. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_anonymous: If the name version are system generated (anonymous registration). - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar data_uri: [Required] Uri of the data. Example: - `https://go.microsoft.com/fwlink/?linkid=2202330 - `_. Required. - :vartype data_uri: str - :ivar data_type: [Required] Specifies the type of data. Required. URI_FOLDER. - :vartype data_type: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.URI_FOLDER - """ - - data_type: Literal[DataType.URI_FOLDER] = rest_discriminator(name="dataType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of data. Required. URI_FOLDER.""" - - @overload - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - tags: Optional[dict[str, str]] = None, - is_anonymous: Optional[bool] = None, - is_archived: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.data_type = DataType.URI_FOLDER # type: ignore - - -class UriFolderJobInput(JobInput, discriminator="uri_folder"): - """UriFolderJobInput. - - :ivar description: Description for the input. - :vartype description: str - :ivar mode: Enum to determine the input data delivery mode. Known values are: "ReadOnlyMount", - "ReadWriteMount", "Download", "Direct", "EvalMount", and "EvalDownload". - :vartype mode: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InputDeliveryMode - :ivar uri: [Required] Input Asset URI. Required. - :vartype uri: str - :ivar job_input_type: [Required] Specifies the type of job. Required. URI_FOLDER. - :vartype job_input_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.URI_FOLDER - """ - - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Enum to determine the input data delivery mode. Known values are: \"ReadOnlyMount\", - \"ReadWriteMount\", \"Download\", \"Direct\", \"EvalMount\", and \"EvalDownload\".""" - uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """[Required] Input Asset URI. Required.""" - job_input_type: Literal[JobInputType.URI_FOLDER] = rest_discriminator(name="jobInputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. URI_FOLDER.""" - - @overload - def __init__( - self, - *, - uri: str, - description: Optional[str] = None, - mode: Optional[Union[str, "_models.InputDeliveryMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_input_type = JobInputType.URI_FOLDER # type: ignore - - -class UriFolderJobOutput(JobOutput, discriminator="uri_folder"): - """UriFolderJobOutput. - - :ivar description: Description for the output. - :vartype description: str - :ivar asset_name: Output Asset Name. - :vartype asset_name: str - :ivar mode: Output data delivery mode enums. Known values are: "ReadWriteMount", "Upload", and - "Direct". - :vartype mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutputDeliveryMode - :ivar uri: Output Asset URI. - :vartype uri: str - :ivar job_output_type: [Required] Specifies the type of job. Required. URI_FOLDER. - :vartype job_output_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.URI_FOLDER - """ - - asset_name: Optional[str] = rest_field(name="assetName", visibility=["read", "create", "update", "delete", "query"]) - """Output Asset Name.""" - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = rest_field(visibility=["read", "create"]) - """Output data delivery mode enums. Known values are: \"ReadWriteMount\", \"Upload\", and - \"Direct\".""" - uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Output Asset URI.""" - job_output_type: Literal[JobOutputType.URI_FOLDER] = rest_discriminator(name="jobOutputType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of job. Required. URI_FOLDER.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - asset_name: Optional[str] = None, - mode: Optional[Union[str, "_models.OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_output_type = JobOutputType.URI_FOLDER # type: ignore - - -class Usage(_Model): - """Describes AML Resource Usage. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. "Count" - :vartype unit: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: int - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: int - :ivar name: The name of the type of usage. - :vartype name: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UsageName - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Specifies the resource ID.""" - aml_workspace_location: Optional[str] = rest_field(name="amlWorkspaceLocation", visibility=["read"]) - """Region of the AML workspace in the id.""" - type: Optional[str] = rest_field(visibility=["read"]) - """Specifies the resource type.""" - unit: Optional[Union[str, "_models.UsageUnit"]] = rest_field(visibility=["read"]) - """An enum describing the unit of usage measurement. \"Count\"""" - current_value: Optional[int] = rest_field(name="currentValue", visibility=["read"]) - """The current usage of the resource.""" - limit: Optional[int] = rest_field(visibility=["read"]) - """The maximum permitted usage of the resource.""" - name: Optional["_models.UsageName"] = rest_field(visibility=["read"]) - """The name of the type of usage.""" - - -class UsageAndQuotaDetails(_Model): - """UsageAndQuotaDetails. - - :ivar model_collection: Model collection name. - :vartype model_collection: str - :ivar quota: The total number of quota. - :vartype quota: int - :ivar usage_details: Usage details for each deployment. - :vartype usage_details: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PTUDeploymentUsage] - """ - - model_collection: Optional[str] = rest_field( - name="modelCollection", visibility=["read", "create", "update", "delete", "query"] - ) - """Model collection name.""" - quota: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The total number of quota.""" - usage_details: Optional[list["_models.PTUDeploymentUsage"]] = rest_field( - name="usageDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Usage details for each deployment.""" - - @overload - def __init__( - self, - *, - model_collection: Optional[str] = None, - quota: Optional[int] = None, - usage_details: Optional[list["_models.PTUDeploymentUsage"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UsageName(_Model): - """The Usage Names. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - value: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - localized_value: Optional[str] = rest_field(name="localizedValue", visibility=["read"]) - """The localized name of the resource.""" - - -class UserAccountCredentials(_Model): - """Settings for user account that gets created on each on the nodes of a compute. - - :ivar admin_user_name: User name. Required. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password. - :vartype admin_user_password: str - """ - - admin_user_name: str = rest_field(name="adminUserName", visibility=["read", "create", "update", "delete", "query"]) - """User name. Required.""" - admin_user_ssh_public_key: Optional[str] = rest_field( - name="adminUserSshPublicKey", visibility=["read", "create", "update", "delete", "query"] - ) - """SSH public key.""" - admin_user_password: Optional[str] = rest_field( - name="adminUserPassword", visibility=["read", "create", "update", "delete", "query"] - ) - """Password.""" - - @overload - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UserAssignedIdentity(_Model): - """User assigned identity properties. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID of the assigned identity.""" - client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) - """The client ID of the assigned identity.""" - - -class UserIdentity(IdentityConfiguration, discriminator="UserIdentity"): - """User identity configuration. - - :ivar identity_type: [Required] Specifies the type of identity framework. Required. - USER_IDENTITY. - :vartype identity_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.USER_IDENTITY - """ - - identity_type: Literal[IdentityConfigurationType.USER_IDENTITY] = rest_discriminator(name="identityType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """[Required] Specifies the type of identity framework. Required. USER_IDENTITY.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.identity_type = IdentityConfigurationType.USER_IDENTITY # type: ignore - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties( - WorkspaceConnectionPropertiesV2, discriminator="UsernamePassword" -): # pylint: disable=name-too-long - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", - "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", - "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", - "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", - "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Known values are: "Required", "NotRequired", and "NotApplicable". - :vartype pe_requirement: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPERequirement - :ivar pe_status: Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionUsernamePassword - :ivar auth_type: Authentication type of the connection target. Required. USERNAME_PASSWORD. - :vartype auth_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.USERNAME_PASSWORD - """ - - credentials: Optional["_models.WorkspaceConnectionUsernamePassword"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auth_type: Literal[ConnectionAuthType.USERNAME_PASSWORD] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. USERNAME_PASSWORD.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.WorkspaceConnectionUsernamePassword"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.USERNAME_PASSWORD # type: ignore - - -class VirtualMachine(Compute, discriminator="VirtualMachine"): - """A Machine Learning compute based on Azure Virtual Machines. - - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Known values are: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSchemaProperties - :ivar compute_type: The type of compute. Required. VIRTUAL_MACHINE. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VIRTUAL_MACHINE - """ - - properties: Optional["_models.VirtualMachineSchemaProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - compute_type: Literal[ComputeType.VIRTUAL_MACHINE] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. VIRTUAL_MACHINE.""" - - @overload - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["_models.VirtualMachineSchemaProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.VIRTUAL_MACHINE # type: ignore - - -class VirtualMachineImage(_Model): - """Virtual Machine image for Windows AML Compute. - - :ivar id: Virtual Machine image path. Required. - :vartype id: str - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Virtual Machine image path. Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VirtualMachineSchemaProperties(_Model): - """VirtualMachineSchemaProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar notebook_server_port: Notebook server port open for ssh connections. - :vartype notebook_server_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - virtual_machine_size: Optional[str] = rest_field( - name="virtualMachineSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Virtual Machine size.""" - ssh_port: Optional[int] = rest_field(name="sshPort", visibility=["read", "create", "update", "delete", "query"]) - """Port open for ssh connections.""" - notebook_server_port: Optional[int] = rest_field( - name="notebookServerPort", visibility=["read", "create", "update", "delete", "query"] - ) - """Notebook server port open for ssh connections.""" - address: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Public IP address of the virtual machine.""" - administrator_account: Optional["_models.VirtualMachineSshCredentials"] = rest_field( - name="administratorAccount", visibility=["read", "create", "update", "delete", "query"] - ) - """Admin credentials for virtual machine.""" - is_notebook_instance_compute: Optional[bool] = rest_field( - name="isNotebookInstanceCompute", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates whether this compute will be used for running notebooks.""" - - @overload - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - notebook_server_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["_models.VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VirtualMachineSecrets(ComputeSecrets, discriminator="VirtualMachine"): - """Secrets related to a Machine Learning compute based on AKS. - - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSshCredentials - :ivar compute_type: The type of compute. Required. VIRTUAL_MACHINE. - :vartype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VIRTUAL_MACHINE - """ - - administrator_account: Optional["_models.VirtualMachineSshCredentials"] = rest_field( - name="administratorAccount", visibility=["read", "create", "update", "delete", "query"] - ) - """Admin credentials for virtual machine.""" - compute_type: Literal[ComputeType.VIRTUAL_MACHINE] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute. Required. VIRTUAL_MACHINE.""" - - @overload - def __init__( - self, - *, - administrator_account: Optional["_models.VirtualMachineSshCredentials"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.compute_type = ComputeType.VIRTUAL_MACHINE # type: ignore - - -class VirtualMachineSize(_Model): - """Describes the properties of a VM size. - - :ivar name: Virtual Machine size name. - :vartype name: str - :ivar family: Virtual Machine family name. - :vartype family: str - :ivar v_cp_us: Number of vPUs. - :vartype v_cp_us: int - :ivar gpus: Number of gPUs. - :vartype gpus: int - :ivar os_vhd_size_mb: OS VHD Disk size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: Resource volume size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: Memory size. - :vartype memory_gb: float - :ivar low_priority_capable: Low priority capable. - :vartype low_priority_capable: bool - :ivar premium_io: Premium IO supported. - :vartype premium_io: bool - :ivar estimated_vm_prices: Estimated VM prices. - :vartype estimated_vm_prices: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EstimatedVMPrices - :ivar supported_compute_types: Supported Compute Types. - :vartype supported_compute_types: list[str] - """ - - name: Optional[str] = rest_field(visibility=["read"]) - """Virtual Machine size name.""" - family: Optional[str] = rest_field(visibility=["read"]) - """Virtual Machine family name.""" - v_cp_us: Optional[int] = rest_field(name="vCPUs", visibility=["read"]) - """Number of vPUs.""" - gpus: Optional[int] = rest_field(visibility=["read"]) - """Number of gPUs.""" - os_vhd_size_mb: Optional[int] = rest_field(name="osVhdSizeMB", visibility=["read"]) - """OS VHD Disk size.""" - max_resource_volume_mb: Optional[int] = rest_field(name="maxResourceVolumeMB", visibility=["read"]) - """Resource volume size.""" - memory_gb: Optional[float] = rest_field(name="memoryGB", visibility=["read"]) - """Memory size.""" - low_priority_capable: Optional[bool] = rest_field(name="lowPriorityCapable", visibility=["read"]) - """Low priority capable.""" - premium_io: Optional[bool] = rest_field(name="premiumIO", visibility=["read"]) - """Premium IO supported.""" - estimated_vm_prices: Optional["_models.EstimatedVMPrices"] = rest_field( - name="estimatedVMPrices", visibility=["read", "create", "update", "delete", "query"] - ) - """Estimated VM prices.""" - supported_compute_types: Optional[list[str]] = rest_field( - name="supportedComputeTypes", visibility=["read", "create", "update", "delete", "query"] - ) - """Supported Compute Types.""" - - @overload - def __init__( - self, - *, - estimated_vm_prices: Optional["_models.EstimatedVMPrices"] = None, - supported_compute_types: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VirtualMachineSizeListResult(_Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSize] - """ - - value: Optional[list["_models.VirtualMachineSize"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of virtual machine sizes supported by AmlCompute.""" - - @overload - def __init__( - self, - *, - value: Optional[list["_models.VirtualMachineSize"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VirtualMachineSshCredentials(_Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Username of admin account.""" - password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Password of admin account.""" - public_key_data: Optional[str] = rest_field( - name="publicKeyData", visibility=["read", "create", "update", "delete", "query"] - ) - """Public key data.""" - private_key_data: Optional[str] = rest_field( - name="privateKeyData", visibility=["read", "create", "update", "delete", "query"] - ) - """Private key data.""" - - @overload - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VolumeDefinition(_Model): - """VolumeDefinition. - - :ivar type: Type of Volume Definition. Known values are: "bind", "volume", "tmpfs", and - "npipe". - :vartype type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VolumeDefinitionType - :ivar read_only: Indicate whether to mount volume as readOnly. Default value for this is false. - :vartype read_only: bool - :ivar source: Source of the mount. For bind mounts this is the host path. - :vartype source: str - :ivar target: Target of the mount. For bind mounts this is the path in the container. - :vartype target: str - :ivar consistency: Consistency of the volume. - :vartype consistency: str - :ivar bind: Bind Options of the mount. - :vartype bind: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BindOptions - :ivar volume: Volume Options of the mount. - :vartype volume: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VolumeOptions - :ivar tmpfs: tmpfs option of the mount. - :vartype tmpfs: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.TmpfsOptions - """ - - type: Optional[Union[str, "_models.VolumeDefinitionType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of Volume Definition. Known values are: \"bind\", \"volume\", \"tmpfs\", and \"npipe\".""" - read_only: Optional[bool] = rest_field(name="readOnly", visibility=["read", "create", "update", "delete", "query"]) - """Indicate whether to mount volume as readOnly. Default value for this is false.""" - source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Source of the mount. For bind mounts this is the host path.""" - target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target of the mount. For bind mounts this is the path in the container.""" - consistency: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Consistency of the volume.""" - bind: Optional["_models.BindOptions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Bind Options of the mount.""" - volume: Optional["_models.VolumeOptions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Volume Options of the mount.""" - tmpfs: Optional["_models.TmpfsOptions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """tmpfs option of the mount.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.VolumeDefinitionType"]] = None, - read_only: Optional[bool] = None, - source: Optional[str] = None, - target: Optional[str] = None, - consistency: Optional[str] = None, - bind: Optional["_models.BindOptions"] = None, - volume: Optional["_models.VolumeOptions"] = None, - tmpfs: Optional["_models.TmpfsOptions"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VolumeOptions(_Model): - """VolumeOptions. - - :ivar nocopy: Indicate whether volume is nocopy. - :vartype nocopy: bool - """ - - nocopy: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicate whether volume is nocopy.""" - - @overload - def __init__( - self, - *, - nocopy: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VulnerabilityDetails(_Model): - """VulnerabilityDetails. - - :ivar cve: CVE id. - :vartype cve: str - :ivar cve_url: CVE url. - :vartype cve_url: str - :ivar due_date: DueDate for vulnerability. Provider data or PublishDate + 30 days. - :vartype due_date: ~datetime.datetime - :ivar id: Vulnerability ID. - :vartype id: str - :ivar package_details: Dependency details. - :vartype package_details: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PackageDetails] - :ivar patchable: Indicates if there is a known patch for vulnerability. - :vartype patchable: bool - :ivar provider_id: Vulnerability ID from provider. - :vartype provider_id: str - :ivar publish_date: Vulnerability publish date. - :vartype publish_date: ~datetime.datetime - :ivar risk: Vulnerability Risk value. Known values are: "UNKNOWN", "CRITICAL", "HIGH", - "MEDIUM", and "LOW". - :vartype risk: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VulnerabilityRisk - :ivar solution: Vulnerability description. - :vartype solution: str - :ivar title: Vulnerability name. - :vartype title: str - :ivar vendor_id: Vendor vulnerability ID (USN, GH Advisory, etc). - :vartype vendor_id: str - :ivar vendor_url: Vendor vulnerability url. - :vartype vendor_url: str - """ - - cve: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """CVE id.""" - cve_url: Optional[str] = rest_field(name="cveUrl", visibility=["read", "create", "update", "delete", "query"]) - """CVE url.""" - due_date: Optional[datetime.datetime] = rest_field( - name="dueDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """DueDate for vulnerability. Provider data or PublishDate + 30 days.""" - id: Optional[str] = rest_field(visibility=["read"]) - """Vulnerability ID.""" - package_details: Optional[list["_models.PackageDetails"]] = rest_field( - name="packageDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Dependency details.""" - patchable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates if there is a known patch for vulnerability.""" - provider_id: Optional[str] = rest_field( - name="providerId", visibility=["read", "create", "update", "delete", "query"] - ) - """Vulnerability ID from provider.""" - publish_date: Optional[datetime.datetime] = rest_field( - name="publishDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Vulnerability publish date.""" - risk: Optional[Union[str, "_models.VulnerabilityRisk"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Vulnerability Risk value. Known values are: \"UNKNOWN\", \"CRITICAL\", \"HIGH\", \"MEDIUM\", - and \"LOW\".""" - solution: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Vulnerability description.""" - title: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Vulnerability name.""" - vendor_id: Optional[str] = rest_field(name="vendorId", visibility=["read", "create", "update", "delete", "query"]) - """Vendor vulnerability ID (USN, GH Advisory, etc).""" - vendor_url: Optional[str] = rest_field(name="vendorUrl", visibility=["read", "create", "update", "delete", "query"]) - """Vendor vulnerability url.""" - - @overload - def __init__( - self, - *, - cve: Optional[str] = None, - cve_url: Optional[str] = None, - due_date: Optional[datetime.datetime] = None, - package_details: Optional[list["_models.PackageDetails"]] = None, - patchable: Optional[bool] = None, - provider_id: Optional[str] = None, - publish_date: Optional[datetime.datetime] = None, - risk: Optional[Union[str, "_models.VulnerabilityRisk"]] = None, - solution: Optional[str] = None, - title: Optional[str] = None, - vendor_id: Optional[str] = None, - vendor_url: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class VulnerabilityFindings(_Model): - """VulnerabilityFindings. - - :ivar asset_id: AssetId (Image digest). - :vartype asset_id: str - :ivar critical_findings_count: Number of critical findings. - :vartype critical_findings_count: int - :ivar data: List of vulnerability findings. - :vartype data: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VulnerabilityDetails] - :ivar generated_time: Time the report was generated. - :vartype generated_time: ~datetime.datetime - :ivar high_findings_count: Number of high findings. - :vartype high_findings_count: int - :ivar last_scan_date: Scan result date. - :vartype last_scan_date: ~datetime.datetime - :ivar scanner: Vulnerability scanner name. - :vartype scanner: str - :ivar source: Data source (internal). - :vartype source: str - :ivar total_findings_count: Total findings count. - :vartype total_findings_count: int - """ - - asset_id: Optional[str] = rest_field(name="assetId", visibility=["read", "create", "update", "delete", "query"]) - """AssetId (Image digest).""" - critical_findings_count: Optional[int] = rest_field(name="criticalFindingsCount", visibility=["read"]) - """Number of critical findings.""" - data: Optional[list["_models.VulnerabilityDetails"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of vulnerability findings.""" - generated_time: Optional[datetime.datetime] = rest_field( - name="generatedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Time the report was generated.""" - high_findings_count: Optional[int] = rest_field(name="highFindingsCount", visibility=["read"]) - """Number of high findings.""" - last_scan_date: Optional[datetime.datetime] = rest_field( - name="lastScanDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Scan result date.""" - scanner: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Vulnerability scanner name.""" - source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Data source (internal).""" - total_findings_count: Optional[int] = rest_field(name="totalFindingsCount", visibility=["read"]) - """Total findings count.""" - - @overload - def __init__( - self, - *, - asset_id: Optional[str] = None, - data: Optional[list["_models.VulnerabilityDetails"]] = None, - generated_time: Optional[datetime.datetime] = None, - last_scan_date: Optional[datetime.datetime] = None, - scanner: Optional[str] = None, - source: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Workspace(ProxyResource): - """An object that represents a machine learning workspace. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Additional attributes of the entity. Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceProperties - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar kind: - :vartype kind: str - :ivar location: - :vartype location: str - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - :ivar tags: - :vartype tags: dict[str, str] - """ - - properties: "_models.WorkspaceProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional attributes of the entity. Required.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional. This field is required to be implemented by the RP because AML is supporting more - than one tier.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - __flattened_items = [ - "agents_endpoint_uri", - "allow_public_access_when_behind_vnet", - "allow_role_assignment_on_rg", - "application_insights", - "associated_workspaces", - "container_registries", - "container_registry", - "description", - "discovery_url", - "enable_data_isolation", - "enable_service_side_cmk_encryption", - "enable_simplified_cmk", - "enable_software_bill_of_materials", - "encryption", - "existing_workspaces", - "feature_store_settings", - "friendly_name", - "hbi_workspace", - "hub_resource_id", - "image_build_compute", - "ip_allowlist", - "key_vault", - "key_vaults", - "managed_network", - "ml_flow_tracking_uri", - "network_acls", - "notebook_info", - "primary_user_assigned_identity", - "private_endpoint_connections", - "private_link_count", - "provision_network_now", - "provisioning_state", - "public_network_access", - "serverless_compute_settings", - "service_managed_resources_settings", - "service_provisioned_resource_group", - "shared_private_link_resources", - "soft_delete_retention_in_days", - "storage_account", - "storage_accounts", - "storage_hns_enabled", - "system_datastores_auth_mode", - "tenant_id", - "v1_legacy_mode", - "workspace_hub_config", - "workspace_id", - ] - - @overload - def __init__( - self, - *, - properties: "_models.WorkspaceProperties", - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[str] = None, - location: Optional[str] = None, - sku: Optional["_models.Sku"] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class WorkspaceConnectionAccessKey(_Model): - """WorkspaceConnectionAccessKey. - - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str - """ - - access_key_id: Optional[str] = rest_field( - name="accessKeyId", visibility=["read", "create", "update", "delete", "query"] - ) - secret_access_key: Optional[str] = rest_field( - name="secretAccessKey", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionAccountKey(_Model): - """Account key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - key: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionApiKey(_Model): - """Api key object for workspace connection credential. - - :ivar key: - :vartype key: str - """ - - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - key: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionManagedIdentity(_Model): - """WorkspaceConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - client_id: Optional[str] = None, - resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionOAuth2(_Model): - """ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 - provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' which - requires UsernamePassword. - :vartype username: str - """ - - auth_url: Optional[str] = rest_field(name="authUrl", visibility=["read", "create", "update", "delete", "query"]) - """Required by Concur connection category.""" - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - """Client id in the format of UUID.""" - client_secret: Optional[str] = rest_field( - name="clientSecret", visibility=["read", "create", "update", "delete", "query"] - ) - developer_token: Optional[str] = rest_field( - name="developerToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Required by GoogleAdWords connection category.""" - password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - refresh_token: Optional[str] = rest_field( - name="refreshToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho where user - needs to get RefreshToken offline.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """Required by QuickBooks and Xero connection categories.""" - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Concur, ServiceNow auth server AccessToken grant type is 'Password' which requires - UsernamePassword.""" - - @overload - def __init__( - self, - *, - auth_url: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - developer_token: Optional[str] = None, - password: Optional[str] = None, - refresh_token: Optional[str] = None, - tenant_id: Optional[str] = None, - username: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionPersonalAccessToken(_Model): - """WorkspaceConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - pat: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - pat: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionPropertiesV2BasicResource(ProxyResource): # pylint: disable=name-too-long - """Concrete proxy resource types can be created by aliasing this type using a specific property - type. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemData - :ivar properties: Required. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2 - """ - - properties: "_models.WorkspaceConnectionPropertiesV2" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.WorkspaceConnectionPropertiesV2", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionServicePrincipal(_Model): - """WorkspaceConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - client_secret: Optional[str] = rest_field( - name="clientSecret", visibility=["read", "create", "update", "delete", "query"] - ) - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionSharedAccessSignature(_Model): - """WorkspaceConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - sas: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - sas: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionUpdateParameter(_Model): - """The properties that the machine learning workspace connection will be updated with. - - :ivar properties: The properties that the machine learning workspace connection will be updated - with. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2 - """ - - properties: Optional["_models.WorkspaceConnectionPropertiesV2"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties that the machine learning workspace connection will be updated with.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.WorkspaceConnectionPropertiesV2"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceConnectionUsernamePassword(_Model): - """WorkspaceConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - security_token: Optional[str] = rest_field( - name="securityToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional, required by connections like SalesForce for extra security in addition to - UsernamePassword.""" - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - password: Optional[str] = None, - security_token: Optional[str] = None, - username: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceHubConfig(_Model): - """WorkspaceHub's configuration object. - - :ivar additional_workspace_storage_accounts: - :vartype additional_workspace_storage_accounts: list[str] - :ivar default_workspace_resource_group: - :vartype default_workspace_resource_group: str - """ - - additional_workspace_storage_accounts: Optional[list[str]] = rest_field( - name="additionalWorkspaceStorageAccounts", visibility=["read", "create", "update", "delete", "query"] - ) - default_workspace_resource_group: Optional[str] = rest_field( - name="defaultWorkspaceResourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - additional_workspace_storage_accounts: Optional[list[str]] = None, - default_workspace_resource_group: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspacePrivateEndpointResource(_Model): - """The Private Endpoint resource. - - :ivar id: e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. - :vartype id: str - :ivar subnet_arm_id: The subnetId that the private endpoint is connected to. - :vartype subnet_arm_id: str - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """e.g. - /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}.""" - subnet_arm_id: Optional[str] = rest_field(name="subnetArmId", visibility=["read"]) - """The subnetId that the private endpoint is connected to.""" - - -class WorkspaceProperties(_Model): - """The properties of a machine learning workspace. - - :ivar agents_endpoint_uri: The URI of agents endpoint associated with this workspace. - :vartype agents_endpoint_uri: str - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar allow_role_assignment_on_rg: The flag to indicate whether we will do role assignment for - the workspace MSI on resource group level. - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar associated_workspaces: - :vartype associated_workspaces: list[str] - :ivar container_registries: - :vartype container_registries: list[str] - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_service_side_cmk_encryption: - :vartype enable_service_side_cmk_encryption: bool - :ivar enable_simplified_cmk: Flag to tell if simplified CMK should be enabled for this - workspace. - :vartype enable_simplified_cmk: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EncryptionProperty - :ivar existing_workspaces: - :vartype existing_workspaces: list[str] - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar hub_resource_id: - :vartype hub_resource_id: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar key_vaults: - :vartype key_vaults: list[str] - :ivar managed_network: - :vartype managed_network: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettings - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - :ivar network_acls: A set of rules governing the network accessibility of the workspace. - :vartype network_acls: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NetworkAcls - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotebookResourceInfo - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection] - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar provision_network_now: Set to trigger the provisioning of the managed VNet with the - default Options when creating a Workspace with the managed VNet enabled, or else it does - nothing. - :vartype provision_network_now: bool - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Known values are: "Unknown", - "Updating", "Creating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ProvisioningState - :ivar public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceManagedResourcesSettings - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SharedPrivateLinkResource] - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar storage_accounts: - :vartype storage_accounts: list[str] - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Known values are: "AccessKey", "Identity", and "UserDelegationSAS". - :vartype system_datastores_auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemDatastoresAuthMode - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - :ivar workspace_hub_config: WorkspaceHub's configuration object. - :vartype workspace_hub_config: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceHubConfig - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - """ - - agents_endpoint_uri: Optional[str] = rest_field(name="agentsEndpointUri", visibility=["read"]) - """The URI of agents endpoint associated with this workspace.""" - allow_public_access_when_behind_vnet: Optional[bool] = rest_field( - name="allowPublicAccessWhenBehindVnet", visibility=["read", "create", "update", "delete", "query"] - ) - """The flag to indicate whether to allow public access when behind VNet.""" - allow_role_assignment_on_rg: Optional[bool] = rest_field( - name="allowRoleAssignmentOnRG", visibility=["read", "create", "update", "delete", "query"] - ) - """The flag to indicate whether we will do role assignment for the workspace MSI on resource group - level.""" - application_insights: Optional[str] = rest_field( - name="applicationInsights", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM id of the application insights associated with this workspace.""" - associated_workspaces: Optional[list[str]] = rest_field( - name="associatedWorkspaces", visibility=["read", "create", "update", "delete", "query"] - ) - container_registries: Optional[list[str]] = rest_field( - name="containerRegistries", visibility=["read", "create", "update", "delete", "query"] - ) - container_registry: Optional[str] = rest_field( - name="containerRegistry", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM id of the container registry associated with this workspace.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of this workspace.""" - discovery_url: Optional[str] = rest_field( - name="discoveryUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Url for the discovery service to identify regional endpoints for machine learning - experimentation services.""" - enable_data_isolation: Optional[bool] = rest_field( - name="enableDataIsolation", visibility=["read", "create", "update", "delete", "query"] - ) - enable_service_side_cmk_encryption: Optional[bool] = rest_field( - name="enableServiceSideCMKEncryption", visibility=["read", "create", "update", "delete", "query"] - ) - enable_simplified_cmk: Optional[bool] = rest_field( - name="enableSimplifiedCmk", visibility=["read", "create", "update", "delete", "query"] - ) - """Flag to tell if simplified CMK should be enabled for this workspace.""" - enable_software_bill_of_materials: Optional[bool] = rest_field( - name="enableSoftwareBillOfMaterials", visibility=["read", "create", "update", "delete", "query"] - ) - """Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace.""" - encryption: Optional["_models.EncryptionProperty"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - existing_workspaces: Optional[list[str]] = rest_field( - name="existingWorkspaces", visibility=["read", "create", "update", "delete", "query"] - ) - feature_store_settings: Optional["_models.FeatureStoreSettings"] = rest_field( - name="featureStoreSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings for feature store type workspace.""" - friendly_name: Optional[str] = rest_field( - name="friendlyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The friendly name for this workspace. This name in mutable.""" - hbi_workspace: Optional[bool] = rest_field( - name="hbiWorkspace", visibility=["read", "create", "update", "delete", "query"] - ) - """The flag to signal HBI data in the workspace and reduce diagnostic data collected by the - service.""" - hub_resource_id: Optional[str] = rest_field( - name="hubResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - image_build_compute: Optional[str] = rest_field( - name="imageBuildCompute", visibility=["read", "create", "update", "delete", "query"] - ) - """The compute name for image build.""" - ip_allowlist: Optional[list[str]] = rest_field( - name="ipAllowlist", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of IPv4 addresses that are allowed to access the workspace.""" - key_vault: Optional[str] = rest_field(name="keyVault", visibility=["read", "create", "update", "delete", "query"]) - """ARM id of the key vault associated with this workspace. This cannot be changed once the - workspace has been created.""" - key_vaults: Optional[list[str]] = rest_field( - name="keyVaults", visibility=["read", "create", "update", "delete", "query"] - ) - managed_network: Optional["_models.ManagedNetworkSettings"] = rest_field( - name="managedNetwork", visibility=["read", "create", "update", "delete", "query"] - ) - ml_flow_tracking_uri: Optional[str] = rest_field(name="mlFlowTrackingUri", visibility=["read"]) - """The URI associated with this workspace that machine learning flow must point at to set up - tracking.""" - network_acls: Optional["_models.NetworkAcls"] = rest_field( - name="networkAcls", visibility=["read", "create", "update", "delete", "query"] - ) - """A set of rules governing the network accessibility of the workspace.""" - notebook_info: Optional["_models.NotebookResourceInfo"] = rest_field(name="notebookInfo", visibility=["read"]) - """The notebook info of Azure ML workspace.""" - primary_user_assigned_identity: Optional[str] = rest_field( - name="primaryUserAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """The user assigned identity resource id that represents the workspace identity.""" - private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field( - name="privateEndpointConnections", visibility=["read"] - ) - """The list of private endpoint connections in the workspace.""" - private_link_count: Optional[int] = rest_field(name="privateLinkCount", visibility=["read"]) - """Count of private connections in the workspace.""" - provision_network_now: Optional[bool] = rest_field( - name="provisionNetworkNow", visibility=["read", "create", "update", "delete", "query"] - ) - """Set to trigger the provisioning of the managed VNet with the default Options when creating a - Workspace with the managed VNet enabled, or else it does nothing.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The current deployment state of workspace resource. The provisioningState is to indicate states - for resource provisioning. Known values are: \"Unknown\", \"Updating\", \"Creating\", - \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - public_network_access: Optional[Union[str, "_models.PublicNetworkAccessType"]] = rest_field( - name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether requests from Public Network are allowed. Known values are: \"Enabled\" and - \"Disabled\".""" - serverless_compute_settings: Optional["_models.ServerlessComputeSettings"] = rest_field( - name="serverlessComputeSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings for serverless compute in a workspace.""" - service_managed_resources_settings: Optional["_models.ServiceManagedResourcesSettings"] = rest_field( - name="serviceManagedResourcesSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """The service managed resource settings.""" - service_provisioned_resource_group: Optional[str] = rest_field( - name="serviceProvisionedResourceGroup", visibility=["read"] - ) - """The name of the managed resource group created by workspace RP in customer subscription if the - workspace is CMK workspace.""" - shared_private_link_resources: Optional[list["_models.SharedPrivateLinkResource"]] = rest_field( - name="sharedPrivateLinkResources", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of shared private link resources in this workspace.""" - soft_delete_retention_in_days: Optional[int] = rest_field( - name="softDeleteRetentionInDays", visibility=["read", "create", "update", "delete", "query"] - ) - """Retention time in days after workspace get soft deleted.""" - storage_account: Optional[str] = rest_field( - name="storageAccount", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM id of the storage account associated with this workspace. This cannot be changed once the - workspace has been created.""" - storage_accounts: Optional[list[str]] = rest_field( - name="storageAccounts", visibility=["read", "create", "update", "delete", "query"] - ) - storage_hns_enabled: Optional[bool] = rest_field(name="storageHnsEnabled", visibility=["read"]) - """If the storage associated with the workspace has hierarchical namespace(HNS) enabled.""" - system_datastores_auth_mode: Optional[Union[str, "_models.SystemDatastoresAuthMode"]] = rest_field( - name="systemDatastoresAuthMode", visibility=["read", "create", "update", "delete", "query"] - ) - """The auth mode used for accessing the system datastores of the workspace. Known values are: - \"AccessKey\", \"Identity\", and \"UserDelegationSAS\".""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant id associated with this workspace.""" - v1_legacy_mode: Optional[bool] = rest_field( - name="v1LegacyMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Enabling v1_legacy_mode may prevent you from using features provided by the v2 API.""" - workspace_hub_config: Optional["_models.WorkspaceHubConfig"] = rest_field( - name="workspaceHubConfig", visibility=["read", "create", "update", "delete", "query"] - ) - """WorkspaceHub's configuration object.""" - workspace_id: Optional[str] = rest_field(name="workspaceId", visibility=["read"]) - """The immutable id associated with this workspace.""" - - @overload - def __init__( # pylint: disable=too-many-locals - self, - *, - allow_public_access_when_behind_vnet: Optional[bool] = None, - allow_role_assignment_on_rg: Optional[bool] = None, - application_insights: Optional[str] = None, - associated_workspaces: Optional[list[str]] = None, - container_registries: Optional[list[str]] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - discovery_url: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_service_side_cmk_encryption: Optional[bool] = None, - enable_simplified_cmk: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["_models.EncryptionProperty"] = None, - existing_workspaces: Optional[list[str]] = None, - feature_store_settings: Optional["_models.FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - hbi_workspace: Optional[bool] = None, - hub_resource_id: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[list[str]] = None, - key_vault: Optional[str] = None, - key_vaults: Optional[list[str]] = None, - managed_network: Optional["_models.ManagedNetworkSettings"] = None, - network_acls: Optional["_models.NetworkAcls"] = None, - primary_user_assigned_identity: Optional[str] = None, - provision_network_now: Optional[bool] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["_models.ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["_models.ServiceManagedResourcesSettings"] = None, - shared_private_link_resources: Optional[list["_models.SharedPrivateLinkResource"]] = None, - soft_delete_retention_in_days: Optional[int] = None, - storage_account: Optional[str] = None, - storage_accounts: Optional[list[str]] = None, - system_datastores_auth_mode: Optional[Union[str, "_models.SystemDatastoresAuthMode"]] = None, - v1_legacy_mode: Optional[bool] = None, - workspace_hub_config: Optional["_models.WorkspaceHubConfig"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspacePropertiesUpdateParameters(_Model): - """The parameters for updating a machine learning workspace. - - :ivar allow_role_assignment_on_rg: - :vartype allow_role_assignment_on_rg: bool - :ivar application_insights: ARM id of the application insights associated with this workspace. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :vartype container_registry: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar enable_data_isolation: - :vartype enable_data_isolation: bool - :ivar enable_software_bill_of_materials: Flag to tell if SoftwareBillOfMaterials should be - enabled for this workspace. - :vartype enable_software_bill_of_materials: bool - :ivar encryption: - :vartype encryption: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EncryptionUpdateProperties - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeatureStoreSettings - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar ip_allowlist: The list of IPv4 addresses that are allowed to access the workspace. - :vartype ip_allowlist: list[str] - :ivar managed_network: - :vartype managed_network: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettings - :ivar network_acls: A set of rules governing the network accessibility of the workspace. - :vartype network_acls: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NetworkAcls - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PublicNetworkAccessType - :ivar serverless_compute_settings: Settings for serverless compute in a workspace. - :vartype serverless_compute_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessComputeSettings - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServiceManagedResourcesSettings - :ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted. - :vartype soft_delete_retention_in_days: int - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. Known values are: "AccessKey", "Identity", and "UserDelegationSAS". - :vartype system_datastores_auth_mode: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SystemDatastoresAuthMode - :ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by - the v2 API. - :vartype v1_legacy_mode: bool - """ - - allow_role_assignment_on_rg: Optional[bool] = rest_field( - name="allowRoleAssignmentOnRG", visibility=["read", "create", "update", "delete", "query"] - ) - application_insights: Optional[str] = rest_field( - name="applicationInsights", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM id of the application insights associated with this workspace.""" - container_registry: Optional[str] = rest_field( - name="containerRegistry", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM id of the container registry associated with this workspace.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of this workspace.""" - enable_data_isolation: Optional[bool] = rest_field( - name="enableDataIsolation", visibility=["read", "create", "update", "delete", "query"] - ) - enable_software_bill_of_materials: Optional[bool] = rest_field( - name="enableSoftwareBillOfMaterials", visibility=["read", "create", "update", "delete", "query"] - ) - """Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace.""" - encryption: Optional["_models.EncryptionUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - feature_store_settings: Optional["_models.FeatureStoreSettings"] = rest_field( - name="featureStoreSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings for feature store type workspace.""" - friendly_name: Optional[str] = rest_field( - name="friendlyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The friendly name for this workspace. This name in mutable.""" - image_build_compute: Optional[str] = rest_field( - name="imageBuildCompute", visibility=["read", "create", "update", "delete", "query"] - ) - """The compute name for image build.""" - ip_allowlist: Optional[list[str]] = rest_field( - name="ipAllowlist", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of IPv4 addresses that are allowed to access the workspace.""" - managed_network: Optional["_models.ManagedNetworkSettings"] = rest_field( - name="managedNetwork", visibility=["read", "create", "update", "delete", "query"] - ) - network_acls: Optional["_models.NetworkAcls"] = rest_field( - name="networkAcls", visibility=["read", "create", "update", "delete", "query"] - ) - """A set of rules governing the network accessibility of the workspace.""" - primary_user_assigned_identity: Optional[str] = rest_field( - name="primaryUserAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] - ) - """The user assigned identity resource id that represents the workspace identity.""" - public_network_access: Optional[Union[str, "_models.PublicNetworkAccessType"]] = rest_field( - name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether requests from Public Network are allowed. Known values are: \"Enabled\" and - \"Disabled\".""" - serverless_compute_settings: Optional["_models.ServerlessComputeSettings"] = rest_field( - name="serverlessComputeSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Settings for serverless compute in a workspace.""" - service_managed_resources_settings: Optional["_models.ServiceManagedResourcesSettings"] = rest_field( - name="serviceManagedResourcesSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """The service managed resource settings.""" - soft_delete_retention_in_days: Optional[int] = rest_field( - name="softDeleteRetentionInDays", visibility=["read", "create", "update", "delete", "query"] - ) - """Retention time in days after workspace get soft deleted.""" - system_datastores_auth_mode: Optional[Union[str, "_models.SystemDatastoresAuthMode"]] = rest_field( - name="systemDatastoresAuthMode", visibility=["read", "create", "update", "delete", "query"] - ) - """The auth mode used for accessing the system datastores of the workspace. Known values are: - \"AccessKey\", \"Identity\", and \"UserDelegationSAS\".""" - v1_legacy_mode: Optional[bool] = rest_field( - name="v1LegacyMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Enabling v1_legacy_mode may prevent you from using features provided by the v2 API.""" - - @overload - def __init__( - self, - *, - allow_role_assignment_on_rg: Optional[bool] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - enable_software_bill_of_materials: Optional[bool] = None, - encryption: Optional["_models.EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["_models.FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - ip_allowlist: Optional[list[str]] = None, - managed_network: Optional["_models.ManagedNetworkSettings"] = None, - network_acls: Optional["_models.NetworkAcls"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccessType"]] = None, - serverless_compute_settings: Optional["_models.ServerlessComputeSettings"] = None, - service_managed_resources_settings: Optional["_models.ServiceManagedResourcesSettings"] = None, - soft_delete_retention_in_days: Optional[int] = None, - system_datastores_auth_mode: Optional[Union[str, "_models.SystemDatastoresAuthMode"]] = None, - v1_legacy_mode: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class WorkspaceUpdateParameters(_Model): - """The parameters for updating a machine learning workspace. - - :ivar identity: - :vartype identity: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedServiceIdentity - :ivar properties: The properties that the machine learning workspace will be updated with. - :vartype properties: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspacePropertiesUpdateParameters - :ivar sku: Optional. This field is required to be implemented by the RP because AML is - supporting more than one tier. - :vartype sku: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Sku - :ivar tags: The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - """ - - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - properties: Optional["_models.WorkspacePropertiesUpdateParameters"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties that the machine learning workspace will be updated with.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional. This field is required to be implemented by the RP because AML is supporting more - than one tier.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource tags for the machine learning workspace.""" - - __flattened_items = [ - "allow_role_assignment_on_rg", - "application_insights", - "container_registry", - "description", - "enable_data_isolation", - "enable_software_bill_of_materials", - "encryption", - "feature_store_settings", - "friendly_name", - "image_build_compute", - "ip_allowlist", - "managed_network", - "network_acls", - "primary_user_assigned_identity", - "public_network_access", - "serverless_compute_settings", - "service_managed_resources_settings", - "soft_delete_retention_in_days", - "system_datastores_auth_mode", - "v1_legacy_mode", - ] - - @overload - def __init__( - self, - *, - identity: Optional["_models.ManagedServiceIdentity"] = None, - properties: Optional["_models.WorkspacePropertiesUpdateParameters"] = None, - sku: Optional["_models.Sku"] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_patch.py deleted file mode 100644 index ea765788358a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/__init__.py deleted file mode 100644 index 83e90339d6d0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/__init__.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import Operations # type: ignore -from ._operations import EndpointDeploymentOperations # type: ignore -from ._operations import WorkspacesOperations # type: ignore -from ._operations import CodeContainersOperations # type: ignore -from ._operations import RegistriesOperations # type: ignore -from ._operations import CodeVersionsOperations # type: ignore -from ._operations import ComponentContainersOperations # type: ignore -from ._operations import ComponentVersionsOperations # type: ignore -from ._operations import DataContainersOperations # type: ignore -from ._operations import DataVersionsOperations # type: ignore -from ._operations import EnvironmentContainersOperations # type: ignore -from ._operations import EnvironmentVersionsOperations # type: ignore -from ._operations import ModelContainersOperations # type: ignore -from ._operations import ModelVersionsOperations # type: ignore -from ._operations import BatchEndpointsOperations # type: ignore -from ._operations import BatchDeploymentsOperations # type: ignore -from ._operations import CapabilityHostsOperations # type: ignore -from ._operations import DatastoresOperations # type: ignore -from ._operations import FeaturesetContainersOperations # type: ignore -from ._operations import FeaturesOperations # type: ignore -from ._operations import FeaturesetVersionsOperations # type: ignore -from ._operations import FeaturestoreEntityContainersOperations # type: ignore -from ._operations import FeaturestoreEntityVersionsOperations # type: ignore -from ._operations import InferencePoolsOperations # type: ignore -from ._operations import InferenceEndpointsOperations # type: ignore -from ._operations import InferenceGroupsOperations # type: ignore -from ._operations import MarketplaceSubscriptionsOperations # type: ignore -from ._operations import OnlineEndpointsOperations # type: ignore -from ._operations import OnlineDeploymentsOperations # type: ignore -from ._operations import SchedulesOperations # type: ignore -from ._operations import ServerlessEndpointsOperations # type: ignore -from ._operations import RaiPolicyOperations # type: ignore -from ._operations import PrivateEndpointConnectionsOperations # type: ignore -from ._operations import ComputeOperations # type: ignore -from ._operations import WorkspaceFeaturesOperations # type: ignore -from ._operations import ConnectionOperations # type: ignore -from ._operations import PrivateLinkResourcesOperations # type: ignore -from ._operations import ManagedNetworkProvisionsOperations # type: ignore -from ._operations import RegistryCodeContainersOperations # type: ignore -from ._operations import RegistryDataReferencesOperations # type: ignore -from ._operations import RegistryCodeVersionsOperations # type: ignore -from ._operations import RegistryComponentContainersOperations # type: ignore -from ._operations import RegistryComponentVersionsOperations # type: ignore -from ._operations import RegistryDataContainersOperations # type: ignore -from ._operations import RegistryDataVersionsOperations # type: ignore -from ._operations import RegistryEnvironmentContainersOperations # type: ignore -from ._operations import RegistryEnvironmentVersionsOperations # type: ignore -from ._operations import RegistryModelContainersOperations # type: ignore -from ._operations import RegistryModelVersionsOperations # type: ignore -from ._operations import JobsOperations # type: ignore -from ._operations import WorkspaceConnectionsOperations # type: ignore -from ._operations import ConnectionRaiBlocklistOperations # type: ignore -from ._operations import ConnectionRaiBlocklistsOperations # type: ignore -from ._operations import ConnectionRaiBlocklistItemOperations # type: ignore -from ._operations import ConnectionRaiBlocklistItemsOperations # type: ignore -from ._operations import ConnectionRaiPolicyOperations # type: ignore -from ._operations import ConnectionRaiPoliciesOperations # type: ignore -from ._operations import RaiPoliciesOperations # type: ignore -from ._operations import EndpointOperations # type: ignore -from ._operations import ManagedNetworkSettingsRuleOperations # type: ignore -from ._operations import OutboundRuleOperations # type: ignore -from ._operations import ManagedNetworkSettingsOperations # type: ignore -from ._operations import OutboundRulesOperations # type: ignore -from ._operations import UsagesOperations # type: ignore -from ._operations import VirtualMachineSizesOperations # type: ignore -from ._operations import QuotasOperations # type: ignore -from ._operations import PTUQuotaOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "EndpointDeploymentOperations", - "WorkspacesOperations", - "CodeContainersOperations", - "RegistriesOperations", - "CodeVersionsOperations", - "ComponentContainersOperations", - "ComponentVersionsOperations", - "DataContainersOperations", - "DataVersionsOperations", - "EnvironmentContainersOperations", - "EnvironmentVersionsOperations", - "ModelContainersOperations", - "ModelVersionsOperations", - "BatchEndpointsOperations", - "BatchDeploymentsOperations", - "CapabilityHostsOperations", - "DatastoresOperations", - "FeaturesetContainersOperations", - "FeaturesOperations", - "FeaturesetVersionsOperations", - "FeaturestoreEntityContainersOperations", - "FeaturestoreEntityVersionsOperations", - "InferencePoolsOperations", - "InferenceEndpointsOperations", - "InferenceGroupsOperations", - "MarketplaceSubscriptionsOperations", - "OnlineEndpointsOperations", - "OnlineDeploymentsOperations", - "SchedulesOperations", - "ServerlessEndpointsOperations", - "RaiPolicyOperations", - "PrivateEndpointConnectionsOperations", - "ComputeOperations", - "WorkspaceFeaturesOperations", - "ConnectionOperations", - "PrivateLinkResourcesOperations", - "ManagedNetworkProvisionsOperations", - "RegistryCodeContainersOperations", - "RegistryDataReferencesOperations", - "RegistryCodeVersionsOperations", - "RegistryComponentContainersOperations", - "RegistryComponentVersionsOperations", - "RegistryDataContainersOperations", - "RegistryDataVersionsOperations", - "RegistryEnvironmentContainersOperations", - "RegistryEnvironmentVersionsOperations", - "RegistryModelContainersOperations", - "RegistryModelVersionsOperations", - "JobsOperations", - "WorkspaceConnectionsOperations", - "ConnectionRaiBlocklistOperations", - "ConnectionRaiBlocklistsOperations", - "ConnectionRaiBlocklistItemOperations", - "ConnectionRaiBlocklistItemsOperations", - "ConnectionRaiPolicyOperations", - "ConnectionRaiPoliciesOperations", - "RaiPoliciesOperations", - "EndpointOperations", - "ManagedNetworkSettingsRuleOperations", - "OutboundRuleOperations", - "ManagedNetworkSettingsOperations", - "OutboundRulesOperations", - "UsagesOperations", - "VirtualMachineSizesOperations", - "QuotasOperations", - "PTUQuotaOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_operations.py deleted file mode 100644 index f373d6e3d7f3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_operations.py +++ /dev/null @@ -1,54744 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -import json -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import MachineLearningServicesMgmtClientConfiguration -from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_operations_list_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/providers/Microsoft.MachineLearningServices/operations" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_deployment_get_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_deployment_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_deployment_delete_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - *, - api_version: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_endpoint_deployment_list_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_deployment_get_in_workspace_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - api_version: str, - endpoint_type: Optional[Union[str, _models.EndpointType]] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if endpoint_type is not None: - _params["endpointType"] = _SERIALIZER.query("endpoint_type", endpoint_type, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_get_request( - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_update_request( - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_delete_request( - resource_group_name: str, workspace_name: str, subscription_id: str, *, force_to_purge: bool = False, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if force_to_purge is not None: - _params["forceToPurge"] = _SERIALIZER.query("force_to_purge", force_to_purge, "bool") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_workspaces_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, - subscription_id: str, - *, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if kind is not None: - _params["kind"] = _SERIALIZER.query("kind", kind, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if ai_capabilities is not None: - _params["aiCapabilities"] = _SERIALIZER.query("ai_capabilities", ai_capabilities, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, - *, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if kind is not None: - _params["kind"] = _SERIALIZER.query("kind", kind, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if ai_capabilities is not None: - _params["aiCapabilities"] = _SERIALIZER.query("ai_capabilities", ai_capabilities, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_diagnose_request( - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_list_keys_request( - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_list_notebook_access_token_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_list_notebook_keys_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_list_storage_account_keys_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_list_outbound_network_dependencies_endpoints_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_prepare_notebook_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspaces_resync_keys_request( - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_code_containers_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_code_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_code_containers_delete_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_code_containers_list_request( - resource_group_name: str, workspace_name: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registries_get_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registries_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registries_update_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registries_delete_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registries_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registries_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registries_remove_regions_request( - resource_group_name: str, registry_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_code_versions_get_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_code_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_code_versions_delete_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_code_versions_list_request( - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if hash is not None: - _params["hash"] = _SERIALIZER.query("hash", hash, "str") - if hash_version is not None: - _params["hashVersion"] = _SERIALIZER.query("hash_version", hash_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_code_versions_publish_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_code_versions_create_or_get_start_pending_upload_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_component_containers_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_component_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_component_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_component_containers_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_component_versions_get_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_component_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_component_versions_delete_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_component_versions_list_request( - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_component_versions_publish_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_containers_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_containers_delete_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_data_containers_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_versions_get_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_versions_delete_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_data_versions_list_request( - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["$tags"] = _SERIALIZER.query("tags", tags, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_versions_publish_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_environment_containers_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_environment_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_environment_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_environment_containers_list_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_environment_versions_get_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_environment_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_environment_versions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_environment_versions_list_request( - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_environment_versions_publish_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_containers_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_containers_delete_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_model_containers_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_versions_get_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_versions_delete_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_model_versions_list_request( - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if version is not None: - _params["version"] = _SERIALIZER.query("version", version, "str") - if description is not None: - _params["description"] = _SERIALIZER.query("description", description, "str") - if offset is not None: - _params["offset"] = _SERIALIZER.query("offset", offset, "int") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if properties is not None: - _params["properties"] = _SERIALIZER.query("properties", properties, "str") - if feed is not None: - _params["feed"] = _SERIALIZER.query("feed", feed, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_versions_publish_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_endpoints_get_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_endpoints_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_endpoints_update_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_endpoints_delete_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_batch_endpoints_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_endpoints_list_keys_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_deployments_get_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_deployments_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_deployments_update_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_batch_deployments_delete_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_batch_deployments_list_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_capability_hosts_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_capability_hosts_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_capability_hosts_delete_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_datastores_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_datastores_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - skip_validation: bool = False, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_validation is not None: - _params["skipValidation"] = _SERIALIZER.query("skip_validation", skip_validation, "bool") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_datastores_delete_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_datastores_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - count: int = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: bool = False, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if is_default is not None: - _params["isDefault"] = _SERIALIZER.query("is_default", is_default, "bool") - if names is not None: - _params["names"] = _SERIALIZER.query("names", names, "[str]", div=",") - if search_text is not None: - _params["searchText"] = _SERIALIZER.query("search_text", search_text, "str") - if order_by is not None: - _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if order_by_asc is not None: - _params["orderByAsc"] = _SERIALIZER.query("order_by_asc", order_by_asc, "bool") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_datastores_list_secrets_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featureset_containers_get_entity_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featureset_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featureset_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_featureset_containers_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - if page_size is not None: - _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") - if name is not None: - _params["name"] = _SERIALIZER.query("name", name, "str") - if description is not None: - _params["description"] = _SERIALIZER.query("description", description, "str") - if created_by is not None: - _params["createdBy"] = _SERIALIZER.query("created_by", created_by, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_features_get_request( - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, "str"), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, "str"), - "featureName": _SERIALIZER.url("feature_name", feature_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_features_list_request( - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - subscription_id: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 1000, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "featuresetName": _SERIALIZER.url("featureset_name", featureset_name, "str"), - "featuresetVersion": _SERIALIZER.url("featureset_version", featureset_version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if feature_name is not None: - _params["featureName"] = _SERIALIZER.query("feature_name", feature_name, "str") - if description is not None: - _params["description"] = _SERIALIZER.query("description", description, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - if page_size is not None: - _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featureset_versions_get_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featureset_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featureset_versions_delete_request( - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_featureset_versions_list_request( - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - if page_size is not None: - _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") - if version_name is not None: - _params["versionName"] = _SERIALIZER.query("version_name", version_name, "str") - if version is not None: - _params["version"] = _SERIALIZER.query("version", version, "str") - if description is not None: - _params["description"] = _SERIALIZER.query("description", description, "str") - if created_by is not None: - _params["createdBy"] = _SERIALIZER.query("created_by", created_by, "str") - if stage is not None: - _params["stage"] = _SERIALIZER.query("stage", stage, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featureset_versions_backfill_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featurestore_entity_containers_get_entity_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featurestore_entity_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featurestore_entity_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_featurestore_entity_containers_list_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - if page_size is not None: - _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") - if name is not None: - _params["name"] = _SERIALIZER.query("name", name, "str") - if description is not None: - _params["description"] = _SERIALIZER.query("description", description, "str") - if created_by is not None: - _params["createdBy"] = _SERIALIZER.query("created_by", created_by, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featurestore_entity_versions_get_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featurestore_entity_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_featurestore_entity_versions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_featurestore_entity_versions_list_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - if page_size is not None: - _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") - if version_name is not None: - _params["versionName"] = _SERIALIZER.query("version_name", version_name, "str") - if version is not None: - _params["version"] = _SERIALIZER.query("version", version, "str") - if description is not None: - _params["description"] = _SERIALIZER.query("description", description, "str") - if created_by is not None: - _params["createdBy"] = _SERIALIZER.query("created_by", created_by, "str") - if stage is not None: - _params["stage"] = _SERIALIZER.query("stage", stage, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_pools_get_request( - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_pools_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_pools_update_request( - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_pools_delete_request( - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "inferencePoolName": _SERIALIZER.url("inference_pool_name", inference_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_inference_pools_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - api_version: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if properties is not None: - _params["properties"] = _SERIALIZER.query("properties", properties, "str") - if order_by is not None: - _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_endpoints_get_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_endpoints_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_endpoints_update_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_endpoints_delete_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_inference_endpoints_list_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - subscription_id: str, - *, - api_version: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if properties is not None: - _params["properties"] = _SERIALIZER.query("properties", properties, "str") - if order_by is not None: - _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_get_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_update_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_delete_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_inference_groups_list_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - subscription_id: str, - *, - api_version: str, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if properties is not None: - _params["properties"] = _SERIALIZER.query("properties", properties, "str") - if order_by is not None: - _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_get_delta_models_status_async_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/getStatus" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_list_delta_models_async_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/list" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_modify_delta_models_async_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/deltaModels/modify" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_get_status_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_inference_groups_list_skus_request( - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - subscription_id: str, - *, - api_version: str, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), - "groupName": _SERIALIZER.url("group_name", group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_marketplace_subscriptions_get_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_marketplace_subscriptions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_marketplace_subscriptions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_marketplace_subscriptions_list_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_endpoints_get_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_endpoints_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_endpoints_update_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_endpoints_delete_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_online_endpoints_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, _models.EndpointComputeType]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if name is not None: - _params["name"] = _SERIALIZER.query("name", name, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if compute_type is not None: - _params["computeType"] = _SERIALIZER.query("compute_type", compute_type, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if properties is not None: - _params["properties"] = _SERIALIZER.query("properties", properties, "str") - if order_by is not None: - _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_endpoints_list_keys_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_endpoints_regenerate_keys_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_endpoints_get_token_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_deployments_get_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_deployments_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_deployments_update_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_deployments_delete_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_online_deployments_list_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_deployments_get_logs_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_online_deployments_list_skus_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - subscription_id: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_schedules_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_schedules_create_or_update_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_schedules_delete_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_schedules_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - list_view_type: Union[str, _models.ScheduleListViewType] = "EnabledOnly", - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_serverless_endpoints_get_request( - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_serverless_endpoints_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_serverless_endpoints_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_serverless_endpoints_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_serverless_endpoints_list_request( - resource_group_name: str, workspace_name: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_serverless_endpoints_list_keys_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_serverless_endpoints_regenerate_keys_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_policy_get_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - subscription_id: str, - *, - api_version: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_policy_create_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - subscription_id: str, - *, - api_version: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_policy_delete_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - subscription_id: str, - *, - api_version: str, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_private_endpoint_connections_get_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_private_endpoint_connections_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_private_endpoint_connections_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_private_endpoint_connections_list_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_get_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_create_or_update_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_update_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_delete_request( - resource_group_name: str, - workspace_name: str, - compute_name: str, - subscription_id: str, - *, - underlying_resource_action: Union[str, _models.UnderlyingResourceAction], - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["underlyingResourceAction"] = _SERIALIZER.query( - "underlying_resource_action", underlying_resource_action, "str" - ) - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_compute_list_request( - resource_group_name: str, workspace_name: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_update_custom_services_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_list_nodes_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_list_keys_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_update_data_mounts_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_start_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_compute_stop_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_compute_restart_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_compute_update_idle_shutdown_setting_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_get_allowed_resize_sizes_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_compute_resize_request( - resource_group_name: str, workspace_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspace_features_list_request( - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_get_all_models_request( - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_get_models_request( - resource_group_name: str, - workspace_name: str, - connection_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_get_deployment_request( - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_create_or_update_deployment_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_delete_deployment_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_connection_list_deployments_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_private_link_resources_list_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_provisions_provision_managed_network_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_code_containers_get_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, code_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_code_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, code_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_code_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, code_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_code_containers_list_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_references_get_blob_reference_sas_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_code_versions_get_request( - resource_group_name: str, registry_name: str, code_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_code_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, code_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_code_versions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, code_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_code_versions_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - code_name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_code_versions_create_or_get_start_pending_upload_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, code_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "codeName": _SERIALIZER.url("code_name", code_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_component_containers_get_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, component_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "componentName": _SERIALIZER.url("component_name", component_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_component_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, component_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "componentName": _SERIALIZER.url("component_name", component_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_component_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, component_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "componentName": _SERIALIZER.url("component_name", component_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_component_containers_list_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_component_versions_get_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, component_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "componentName": _SERIALIZER.url("component_name", component_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_component_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, component_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "componentName": _SERIALIZER.url("component_name", component_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_component_versions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, component_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "componentName": _SERIALIZER.url("component_name", component_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_component_versions_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - component_name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "componentName": _SERIALIZER.url("component_name", component_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_containers_get_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_data_containers_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_versions_get_request( - resource_group_name: str, registry_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_versions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_data_versions_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if tags is not None: - _params["$tags"] = _SERIALIZER.query("tags", tags, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_data_versions_create_or_get_start_pending_upload_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_environment_containers_get_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_environment_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_environment_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_environment_containers_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_environment_versions_get_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_environment_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_environment_versions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_environment_versions_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - environment_name: str, - subscription_id: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_model_containers_get_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, model_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_model_containers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, model_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_model_containers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, model_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_model_containers_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_model_versions_get_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, model_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_model_versions_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, model_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_model_versions_delete_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, model_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_registry_model_versions_list_request( # pylint: disable=name-too-long - resource_group_name: str, - registry_name: str, - model_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if order_by is not None: - _params["$orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if version is not None: - _params["version"] = _SERIALIZER.query("version", version, "str") - if description is not None: - _params["description"] = _SERIALIZER.query("description", description, "str") - if tags is not None: - _params["tags"] = _SERIALIZER.query("tags", tags, "str") - if properties is not None: - _params["properties"] = _SERIALIZER.query("properties", properties, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_registry_model_versions_create_or_get_start_pending_upload_request( # pylint: disable=name-too-long - resource_group_name: str, registry_name: str, model_name: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "registryName": _SERIALIZER.url("registry_name", registry_name, "str"), - "modelName": _SERIALIZER.url("model_name", model_name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_jobs_get_request( - resource_group_name: str, workspace_name: str, id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "id": _SERIALIZER.url("id", id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_jobs_create_or_update_request( - resource_group_name: str, workspace_name: str, id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "id": _SERIALIZER.url("id", id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_jobs_delete_request( - resource_group_name: str, workspace_name: str, id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "id": _SERIALIZER.url("id", id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_jobs_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - properties: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if job_type is not None: - _params["jobType"] = _SERIALIZER.query("job_type", job_type, "str") - if tag is not None: - _params["tag"] = _SERIALIZER.query("tag", tag, "str") - if list_view_type is not None: - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") - if properties is not None: - _params["properties"] = _SERIALIZER.query("properties", properties, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_jobs_cancel_request( - resource_group_name: str, workspace_name: str, id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "id": _SERIALIZER.url("id", id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_workspace_connections_get_request( - resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspace_connections_create_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspace_connections_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspace_connections_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_workspace_connections_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: bool = False, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if target is not None: - _params["target"] = _SERIALIZER.query("target", target, "str") - if category is not None: - _params["category"] = _SERIALIZER.query("category", category, "str") - if include_all is not None: - _params["includeAll"] = _SERIALIZER.query("include_all", include_all, "bool") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspace_connections_list_secrets_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_workspace_connections_test_connection_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, connection_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_get_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_create_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_connection_rai_blocklists_list_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_item_add_bulk_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_item_delete_bulk_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_item_get_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_item_create_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_blocklist_item_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - "raiBlocklistItemName": _SERIALIZER.url("rai_blocklist_item_name", rai_blocklist_item_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_connection_rai_blocklist_items_list_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiBlocklistName": _SERIALIZER.url("rai_blocklist_name", rai_blocklist_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_policy_get_request( - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_policy_create_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_connection_rai_policy_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - "raiPolicyName": _SERIALIZER.url("rai_policy_name", rai_policy_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_connection_rai_policies_list_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - connection_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_policies_list_request( - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - subscription_id: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if proxy_api_version is not None: - _params["proxy-api-version"] = _SERIALIZER.query("proxy_api_version", proxy_api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_get_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_create_or_update_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - endpoint_type: Optional[Union[str, _models.EndpointType]] = None, - include_online_endpoints: bool = False, - include_serverless_endpoints: bool = False, - include_connections: bool = False, - skip: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if endpoint_type is not None: - _params["endpointType"] = _SERIALIZER.query("endpoint_type", endpoint_type, "str") - if include_online_endpoints is not None: - _params["includeOnlineEndpoints"] = _SERIALIZER.query( - "include_online_endpoints", include_online_endpoints, "bool" - ) - if include_serverless_endpoints is not None: - _params["includeServerlessEndpoints"] = _SERIALIZER.query( - "include_serverless_endpoints", include_serverless_endpoints, "bool" - ) - if include_connections is not None: - _params["includeConnections"] = _SERIALIZER.query("include_connections", include_connections, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_list_keys_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_get_models_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_endpoint_regenerate_keys_request( - resource_group_name: str, workspace_name: str, endpoint_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_rule_get_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, rule_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_rule_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, rule_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_rule_delete_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, rule_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_managed_network_settings_rule_list_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_outbound_rule_get_request( - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_outbound_rule_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_outbound_rule_delete_request( - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_outbound_rule_list_request( - resource_group_name: str, workspace_name: str, managed_network_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}/outboundRules" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_get_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, managed_network_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_put_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, managed_network_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_patch_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, managed_network_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_list_request( # pylint: disable=name-too-long - resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_outbound_rules_post_request( - resource_group_name: str, workspace_name: str, managed_network_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/managedNetworks/{managedNetworkName}/batchOutboundRules" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_usages_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_virtual_machine_sizes_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_quotas_update_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = ( - "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_quotas_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_ptu_quota_list_available_request( - location: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_ptu_quota_get_available_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/availableQuota/default" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_ptu_quota_list_request( - location: str, subscription_id: str, *, skip: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = ( - "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotaAndUsage" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - List the operations for the provider. - - :return: An iterator like instance of Operation - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Operation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class EndpointDeploymentOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`endpoint_deployment` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> _models.EndpointDeploymentResourcePropertiesBasicResource: - """Get deployments under endpoint resource by name. - - Get deployments under endpoint resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :return: EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_endpoint_deployment_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_endpoint_deployment_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.EndpointDeploymentResourcePropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update endpoint deployment resource with the specified parameters. - - Create or update endpoint deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Is one of the following types: - EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_endpoint_deployment_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - proxy_api_version=proxy_api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Delete endpoint deployment resource by name. - - Delete endpoint deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> ItemPaged["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Get all the deployments under the endpoint resource scope. - - Get all the deployments under the endpoint resource scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: An iterator like instance of EndpointDeploymentResourcePropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointDeploymentResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_deployment_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointDeploymentResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_in_workspace( - self, - resource_group_name: str, - workspace_name: str, - *, - endpoint_type: Optional[Union[str, _models.EndpointType]] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Get all the deployments under the workspace scope. - - Get all the deployments under the workspace scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword endpoint_type: Endpoint type filter. Known values are: "Azure.OpenAI", "Azure.Speech", - "Azure.ContentSafety", "Azure.Llama", "managedOnlineEndpoint", and "serverlessEndpoint". - Default value is None. - :paramtype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointType - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of EndpointDeploymentResourcePropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointDeploymentResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_deployment_get_in_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - endpoint_type=endpoint_type, - skip=skip, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointDeploymentResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class WorkspacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`workspaces` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.Workspace: - """Gets the properties of the specified machine learning workspace. - - Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: Workspace. The Workspace is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) - - _request = build_workspaces_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Workspace, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.Workspace, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_workspaces_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: _models.Workspace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.Workspace, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Creates or updates a workspace with the specified parameters. - - Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for creating or updating a machine learning workspace. Is one of - the following types: Workspace, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace or JSON or - IO[bytes] - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Workspace, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Workspace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Workspace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.WorkspaceUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_workspaces_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: _models.WorkspaceUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - body: Union[_models.WorkspaceUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Workspace]: - """Updates a machine learning workspace with the specified parameters. - - Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameters for updating a machine learning workspace. Is one of the following - types: WorkspaceUpdateParameters, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceUpdateParameters - or JSON or IO[bytes] - :return: An instance of LROPoller that returns Workspace. The Workspace is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Workspace, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Workspace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Workspace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, *, force_to_purge: bool = False, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_workspaces_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - force_to_purge=force_to_purge, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, *, force_to_purge: bool = False, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a machine learning workspace. - - Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword force_to_purge: Flag to indicate delete is a purge request. Default value is False. - :paramtype force_to_purge: bool - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - force_to_purge=force_to_purge, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - *, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.Workspace"]: - """Lists all the available machine learning workspaces under the specified resource group. - - Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword kind: Kind of workspace. Default value is None. - :paramtype kind: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword ai_capabilities: Default value is None. - :paramtype ai_capabilities: str - :return: An iterator like instance of Workspace - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Workspace]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspaces_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Workspace], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription( - self, - *, - kind: Optional[str] = None, - skip: Optional[str] = None, - ai_capabilities: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.Workspace"]: - """Lists all the available machine learning workspaces under the specified subscription. - - Lists all the available machine learning workspaces under the specified subscription. - - :keyword kind: Kind of workspace. Default value is None. - :paramtype kind: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword ai_capabilities: Default value is None. - :paramtype ai_capabilities: str - :return: An iterator like instance of Workspace - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Workspace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Workspace]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspaces_list_by_subscription_request( - subscription_id=self._config.subscription_id, - kind=kind, - skip=skip, - ai_capabilities=ai_capabilities, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Workspace], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.DiagnoseWorkspaceParameters, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspaces_diagnose_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[_models.DiagnoseWorkspaceParameters] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseWorkspaceParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.DiagnoseWorkspaceParameters, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.DiagnoseResponseResult]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: The parameter of diagnosing workspace health. Is one of the following types: - DiagnoseWorkspaceParameters, JSON, IO[bytes] Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseWorkspaceParameters - or JSON or IO[bytes] - :return: An instance of LROPoller that returns DiagnoseResponseResult. The - DiagnoseResponseResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DiagnoseResponseResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.DiagnoseResponseResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DiagnoseResponseResult, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DiagnoseResponseResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DiagnoseResponseResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_keys( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ListWorkspaceKeysResult: - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ListWorkspaceKeysResult. The ListWorkspaceKeysResult is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListWorkspaceKeysResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ListWorkspaceKeysResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ListWorkspaceKeysResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_notebook_access_token( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.NotebookAccessTokenResult: - """Get Azure Machine Learning Workspace notebook access token. - - Get Azure Machine Learning Workspace notebook access token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: NotebookAccessTokenResult. The NotebookAccessTokenResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotebookAccessTokenResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NotebookAccessTokenResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_notebook_access_token_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.NotebookAccessTokenResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_notebook_keys( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ListNotebookKeysResult: - """Lists keys of Azure Machine Learning Workspaces notebook. - - Lists keys of Azure Machine Learning Workspaces notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ListNotebookKeysResult. The ListNotebookKeysResult is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListNotebookKeysResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ListNotebookKeysResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_notebook_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ListNotebookKeysResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_storage_account_keys( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ListStorageAccountKeysResult: - """Lists keys of Azure Machine Learning Workspace's storage account. - - Lists keys of Azure Machine Learning Workspace's storage account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ListStorageAccountKeysResult. The ListStorageAccountKeysResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListStorageAccountKeysResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ListStorageAccountKeysResult] = kwargs.pop("cls", None) - - _request = build_workspaces_list_storage_account_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ListStorageAccountKeysResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> _models.ExternalFQDNResponse: - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: ExternalFQDNResponse. The ExternalFQDNResponse is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ExternalFQDNResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ExternalFQDNResponse] = kwargs.pop("cls", None) - - _request = build_workspaces_list_outbound_network_dependencies_endpoints_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ExternalFQDNResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _prepare_notebook_initial( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_workspaces_prepare_notebook_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_prepare_notebook( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> LROPoller[_models.NotebookResourceInfo]: - """Prepare Azure Machine Learning Workspace's notebook resource. - - Prepare Azure Machine Learning Workspace's notebook resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An instance of LROPoller that returns NotebookResourceInfo. The NotebookResourceInfo - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.NotebookResourceInfo] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NotebookResourceInfo] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NotebookResourceInfo, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.NotebookResourceInfo].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.NotebookResourceInfo]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _resync_keys_initial(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_workspaces_resync_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_resync_keys(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> LROPoller[None]: - """Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - Resync all the keys associated with this workspace.This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class CodeContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`code_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.CodeContainer: - """Get containers. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - - _request = build_code_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.CodeContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.CodeContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.CodeContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - CodeContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer or JSON or - IO[bytes] - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_code_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.CodeContainer"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of CodeContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_code_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registries` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> _models.Registry: - """Get registry. - - Get registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - - _request = build_registries_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Registry, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: _models.Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Create or update registry. - - Create or update registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Is one of the following types: Registry, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry or JSON or - IO[bytes] - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Registry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Registry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Registry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - body: _models.PartialRegistryPartialTrackedResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialRegistryPartialTrackedResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - registry_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.PartialRegistryPartialTrackedResource, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Registry: - """Update tags. - - Update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Is one of the following types: - PartialRegistryPartialTrackedResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialRegistryPartialTrackedResource - or JSON or IO[bytes] - :return: Registry. The Registry is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Registry, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registries_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete registry. - - Delete registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Registry"]: - """List registries. - - List registries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of Registry - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registries_list_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Registry], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Registry"]: - """List registries by subscription. - - List registries by subscription. - - :return: An iterator like instance of Registry - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Registry]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registries_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Registry], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _remove_regions_initial( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registries_remove_regions_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: _models.Registry, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_remove_regions( - self, - resource_group_name: str, - registry_name: str, - body: Union[_models.Registry, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Registry]: - """Remove regions from registry. - - Remove regions from registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param body: Details required to create the registry. Is one of the following types: Registry, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry or JSON or - IO[bytes] - :return: An instance of LROPoller that returns Registry. The Registry is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Registry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Registry] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._remove_regions_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Registry, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Registry].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Registry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class CodeVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`code_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.CodeVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - - _request = build_code_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.CodeVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.CodeVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.CodeVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: CodeVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion or JSON or - IO[bytes] - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_code_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - hash: Optional[str] = None, - hash_version: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.CodeVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword hash: If specified, return CodeVersion assets with specified content hash value, - regardless of name. Default value is None. - :paramtype hash: str - :keyword hash_version: Hash algorithm version when listing by hash. Default value is None. - :paramtype hash_version: str - :return: An iterator like instance of CodeVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_code_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - hash=hash, - hash_version=hash_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_code_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ComponentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`component_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.ComponentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - - _request = build_component_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.ComponentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ComponentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ComponentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - ComponentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer or JSON - or IO[bytes] - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_component_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_component_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ComponentContainer"]: - """List component containers. - - List component containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ComponentContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_component_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ComponentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`component_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.ComponentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - - _request = build_component_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.ComponentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.ComponentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ComponentVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - ComponentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion or JSON or - IO[bytes] - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_component_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_component_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ComponentVersion"]: - """List component versions. - - List component versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ComponentVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_component_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_component_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class DataContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`data_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.DataContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - - _request = build_data_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.DataContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.DataContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DataContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - DataContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer or JSON or - IO[bytes] - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_data_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.DataContainer"]: - """List data containers. - - List data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_data_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class DataVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`data_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.DataVersionBase: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - - _request = build_data_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataVersionBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DataVersionBase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DataVersionBase, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DataVersionBase: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - DataVersionBase, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase or JSON or - IO[bytes] - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataVersionBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_data_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.DataVersionBase"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :keyword order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. Default - value is None. - :paramtype order_by: str - :keyword top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count will be returned. Default - value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataVersionBase - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataVersionBase]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_data_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataVersionBase], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class EnvironmentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`environment_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.EnvironmentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - - _request = build_environment_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.EnvironmentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.EnvironmentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.EnvironmentContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - EnvironmentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer or - JSON or IO[bytes] - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_environment_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_environment_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.EnvironmentContainer"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_environment_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class EnvironmentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`environment_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.EnvironmentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - - _request = build_environment_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.EnvironmentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.EnvironmentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.EnvironmentVersion: - """Creates or updates an EnvironmentVersion. - - Creates or updates an EnvironmentVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Definition of EnvironmentVersion. Is one of the following types: - EnvironmentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion or JSON - or IO[bytes] - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_environment_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_environment_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.EnvironmentVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_environment_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_environment_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ModelContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`model_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.ModelContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - - _request = build_model_containers_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.ModelContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ModelContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ModelContainer: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - ModelContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer or JSON or - IO[bytes] - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> None: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - count: Optional[int] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ModelContainer"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword count: Maximum number of results to return. Default value is None. - :paramtype count: int - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_model_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - count=count, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ModelVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`model_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.ModelVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - - _request = build_model_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.ModelVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ModelVersion: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion or JSON or - IO[bytes] - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> None: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( # pylint: disable=too-many-locals - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - offset: Optional[int] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - feed: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ModelVersion"]: - """List model versions. - - List model versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword version: Model version. Default value is None. - :paramtype version: str - :keyword description: Model description. Default value is None. - :paramtype description: str - :keyword offset: Number of initial results to skip. Default value is None. - :paramtype offset: int - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. Default value is None. - :paramtype properties: str - :keyword feed: Name of the feed. Default value is None. - :paramtype feed: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_model_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _publish_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_versions_publish_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.DestinationAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_publish( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.DestinationAsset, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Publish version asset into registry. - - Publish version asset into registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Destination registry info. Is one of the following types: DestinationAsset, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DestinationAsset or JSON or - IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class BatchEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`batch_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.BatchEndpoint: - """Get batch inference endpoint by name. - - Gets a batch inference endpoint by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :return: BatchEndpoint. The BatchEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.BatchEndpoint] = kwargs.pop("cls", None) - - _request = build_batch_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.BatchEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.BatchEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.BatchEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.BatchEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Create a batch inference endpoint (asynchronous). - - Creates a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Batch inference endpoint definition object. Is one of the following types: - BatchEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint or JSON or - IO[bytes] - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BatchEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BatchEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.PartialMinimalTrackedResourceWithIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BatchEndpoint]: - """Update a batch inference endpoint (asynchronous). - - Update a batch inference endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param body: Mutable batch inference endpoint definition object. Is one of the following types: - PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - or JSON or IO[bytes] - :return: An instance of LROPoller that returns BatchEndpoint. The BatchEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BatchEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BatchEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_batch_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete Batch Inference Endpoint (asynchronous). - - Delete Batch Inference Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.BatchEndpoint"]: - """Lists Batch inference endpoint in the workspace. - - Lists Batch inference endpoint in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword count: Number of endpoints to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of BatchEndpoint - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.BatchEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_batch_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - count=count, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.BatchEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointAuthKeys: - """Lists batch Inference Endpoint keys. - - Lists batch Inference Endpoint keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :return: EndpointAuthKeys. The EndpointAuthKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - - _request = build_batch_endpoints_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class BatchDeploymentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`batch_deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> _models.BatchDeployment: - """Get batch inference deployment by id. - - Gets a batch inference deployment by id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :return: BatchDeployment. The BatchDeployment is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.BatchDeployment] = kwargs.pop("cls", None) - - _request = build_batch_deployments_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.BatchDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.BatchDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_deployments_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.BatchDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.BatchDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Creates/updates a batch inference deployment (asynchronous). - - Creates/updates a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Is one of the following types: - BatchDeployment, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment or JSON or - IO[bytes] - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchDeployment] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BatchDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BatchDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_batch_deployments_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BatchDeployment]: - """Update a batch inference deployment (asynchronous). - - Update a batch inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :param body: Batch inference deployment definition object. Is one of the following types: - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - or JSON or IO[bytes] - :return: An instance of LROPoller that returns BatchDeployment. The BatchDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BatchDeployment] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.BatchDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BatchDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BatchDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_batch_deployments_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete Batch Inference deployment (asynchronous). - - Delete Batch Inference deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :param deployment_name: The identifier for the Batch deployments. Required. - :type deployment_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.BatchDeployment"]: - """Lists Batch inference deployments in the workspace. - - Lists Batch inference deployments in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name for the Batch Endpoint. Required. - :type endpoint_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Top of list. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of BatchDeployment - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.BatchDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.BatchDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_batch_deployments_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.BatchDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class CapabilityHostsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`capability_hosts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.CapabilityHost: - """Get capabilityHost. - - Get capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :return: CapabilityHost. The CapabilityHost is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CapabilityHost] = kwargs.pop("cls", None) - - _request = build_capability_hosts_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CapabilityHost, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.CapabilityHost, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_capability_hosts_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.CapabilityHost, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CapabilityHost. The CapabilityHost is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CapabilityHost. The CapabilityHost is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CapabilityHost. The CapabilityHost is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.CapabilityHost, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CapabilityHost]: - """Create or update capabilityHost. - - Create or update capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :param body: CapabilityHost definition. Is one of the following types: CapabilityHost, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost or JSON or - IO[bytes] - :return: An instance of LROPoller that returns CapabilityHost. The CapabilityHost is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CapabilityHost] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CapabilityHost, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CapabilityHost].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CapabilityHost]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_capability_hosts_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> LROPoller[None]: - """Delete capabilityHost. - - Delete capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: CapabilityHost name. Required. - :type name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class DatastoresOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`datastores` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.Datastore: - """Get datastore. - - Get datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) - - _request = build_datastores_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Datastore, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.Datastore, - *, - skip_validation: bool = False, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - skip_validation: bool = False, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Required. - :type body: JSON - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - skip_validation: bool = False, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Required. - :type body: IO[bytes] - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.Datastore, JSON, IO[bytes]], - *, - skip_validation: bool = False, - **kwargs: Any - ) -> _models.Datastore: - """Create or update datastore. - - Create or update datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Datastore entity to create or update. Is one of the following types: Datastore, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore or JSON or - IO[bytes] - :keyword skip_validation: Flag to skip validation. Default value is False. - :paramtype skip_validation: bool - :return: Datastore. The Datastore is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Datastore] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_datastores_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip_validation=skip_validation, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Datastore, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> None: - """Delete datastore. - - Delete datastore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_datastores_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - count: int = 30, - is_default: Optional[bool] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: bool = False, - **kwargs: Any - ) -> ItemPaged["_models.Datastore"]: - """List datastores. - - List datastores. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword count: Maximum number of results to return. Default value is 30. - :paramtype count: int - :keyword is_default: Filter down to the workspace default datastore. Default value is None. - :paramtype is_default: bool - :keyword names: Names of datastores to return. Default value is None. - :paramtype names: list[str] - :keyword search_text: Text to search for in the datastore names. Default value is None. - :paramtype search_text: str - :keyword order_by: Order by property (createdtime | modifiedtime | name). Default value is - None. - :paramtype order_by: str - :keyword order_by_asc: Order by property in ascending order. Default value is False. - :paramtype order_by_asc: bool - :return: An iterator like instance of Datastore - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Datastore] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Datastore]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_datastores_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - count=count, - is_default=is_default, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Datastore], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[_models.SecretExpiry] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SecretExpiry - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_secrets( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Optional[Union[_models.SecretExpiry, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.DatastoreSecrets: - """Get datastore secrets. - - Get datastore secrets. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Datastore name. Required. - :type name: str - :param body: Secret expiry information. Is one of the following types: SecretExpiry, JSON, - IO[bytes] Default value is None. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SecretExpiry or JSON or - IO[bytes] - :return: DatastoreSecrets. The DatastoreSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DatastoreSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.DatastoreSecrets] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_datastores_list_secrets_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DatastoreSecrets, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class FeaturesetContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`featureset_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get_entity( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.FeaturesetContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: FeaturesetContainer. The FeaturesetContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturesetContainer] = kwargs.pop("cls", None) - - _request = build_featureset_containers_get_entity_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturesetContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturesetContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featureset_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.FeaturesetContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetContainer. The FeaturesetContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetContainer. The FeaturesetContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetContainer. The FeaturesetContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturesetContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.FeaturesetContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - FeaturesetContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer or JSON - or IO[bytes] - :return: An instance of LROPoller that returns FeaturesetContainer. The FeaturesetContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturesetContainer] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturesetContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.FeaturesetContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FeaturesetContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featureset_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> LROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.FeaturesetContainer"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword name: name for the featureset. Default value is None. - :paramtype name: str - :keyword description: description for the feature set. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :return: An iterator like instance of FeaturesetContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturesetContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featureset_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturesetContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class FeaturesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`features` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - feature_name: str, - **kwargs: Any - ) -> _models.Feature: - """Get feature. - - Get feature. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param featureset_name: Name of Azure Machine Learning featuresets. Required. - :type featureset_name: str - :param featureset_version: Inference Version name. Required. - :type featureset_version: str - :param feature_name: Inference FeatureName name. Required. - :type feature_name: str - :return: Feature. The Feature is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Feature - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Feature] = kwargs.pop("cls", None) - - _request = build_features_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - feature_name=feature_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Feature, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - featureset_name: str, - featureset_version: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - feature_name: Optional[str] = None, - description: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 1000, - **kwargs: Any - ) -> ItemPaged["_models.Feature"]: - """List Features. - - List Features. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param featureset_name: Name of Azure Machine Learning featuresets. Required. - :type featureset_name: str - :param featureset_version: Inference Version name. Required. - :type featureset_version: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword feature_name: feature name. Default value is None. - :paramtype feature_name: str - :keyword description: Description of the featureset. Default value is None. - :paramtype description: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: Page size. Default value is 1000. - :paramtype page_size: int - :return: An iterator like instance of Feature - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Feature] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Feature]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_features_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - featureset_name=featureset_name, - featureset_version=featureset_version, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - feature_name=feature_name, - description=description, - list_view_type=list_view_type, - page_size=page_size, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Feature], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class FeaturesetVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`featureset_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.FeaturesetVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: FeaturesetVersion. The FeaturesetVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturesetVersion] = kwargs.pop("cls", None) - - _request = build_featureset_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturesetVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featureset_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.FeaturesetVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - FeaturesetVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion or JSON - or IO[bytes] - :return: An instance of LROPoller that returns FeaturesetVersion. The FeaturesetVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturesetVersion] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturesetVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.FeaturesetVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FeaturesetVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featureset_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( # pylint: disable=too-many-locals - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.FeaturesetVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword version_name: name for the featureset version. Default value is None. - :paramtype version_name: str - :keyword version: featureset version. Default value is None. - :paramtype version: str - :keyword description: description for the feature set version. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :keyword stage: Specifies the featurestore stage. Default value is None. - :paramtype stage: str - :return: An iterator like instance of FeaturesetVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturesetVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featureset_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturesetVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _backfill_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersionBackfillRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featureset_versions_backfill_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.FeaturesetVersionBackfillRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_backfill( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturesetVersionBackfillRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.FeaturesetVersionBackfillResponse]: - """Backfill. - - Backfill. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Feature set version backfill request entity. Is one of the following types: - FeaturesetVersionBackfillRequest, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillRequest or - JSON or IO[bytes] - :return: An instance of LROPoller that returns FeaturesetVersionBackfillResponse. The - FeaturesetVersionBackfillResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturesetVersionBackfillResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturesetVersionBackfillResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._backfill_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturesetVersionBackfillResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.FeaturesetVersionBackfillResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FeaturesetVersionBackfillResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class FeaturestoreEntityContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`featurestore_entity_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get_entity( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.FeaturestoreEntityContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: FeaturestoreEntityContainer. The FeaturestoreEntityContainer is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturestoreEntityContainer] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_containers_get_entity_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturestoreEntityContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturestoreEntityContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featurestore_entity_containers_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.FeaturestoreEntityContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.FeaturestoreEntityContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - FeaturestoreEntityContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer - or JSON or IO[bytes] - :return: An instance of LROPoller that returns FeaturestoreEntityContainer. The - FeaturestoreEntityContainer is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturestoreEntityContainer] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturestoreEntityContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.FeaturestoreEntityContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FeaturestoreEntityContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_containers_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> LROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - name: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.FeaturestoreEntityContainer"]: - """List featurestore entity containers. - - List featurestore entity containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword name: name for the featurestore entity. Default value is None. - :paramtype name: str - :keyword description: description for the featurestore entity. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :return: An iterator like instance of FeaturestoreEntityContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturestoreEntityContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featurestore_entity_containers_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - name=name, - description=description, - created_by=created_by, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturestoreEntityContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class FeaturestoreEntityVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`featurestore_entity_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> _models.FeaturestoreEntityVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: FeaturestoreEntityVersion. The FeaturestoreEntityVersion is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.FeaturestoreEntityVersion] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_versions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.FeaturestoreEntityVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturestoreEntityVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_featurestore_entity_versions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: _models.FeaturestoreEntityVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: Union[_models.FeaturestoreEntityVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.FeaturestoreEntityVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - FeaturestoreEntityVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion - or JSON or IO[bytes] - :return: An instance of LROPoller that returns FeaturestoreEntityVersion. The - FeaturestoreEntityVersion is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FeaturestoreEntityVersion] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.FeaturestoreEntityVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.FeaturestoreEntityVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FeaturestoreEntityVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_featurestore_entity_versions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( # pylint: disable=too-many-locals - self, - resource_group_name: str, - workspace_name: str, - name: str, - *, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - page_size: int = 20, - version_name: Optional[str] = None, - version: Optional[str] = None, - description: Optional[str] = None, - created_by: Optional[str] = None, - stage: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.FeaturestoreEntityVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. This is case-sensitive. Required. - :type name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword page_size: page size. Default value is 20. - :paramtype page_size: int - :keyword version_name: name for the featurestore entity version. Default value is None. - :paramtype version_name: str - :keyword version: featurestore entity version. Default value is None. - :paramtype version: str - :keyword description: description for the feature entity version. Default value is None. - :paramtype description: str - :keyword created_by: createdBy user name. Default value is None. - :paramtype created_by: str - :keyword stage: Specifies the featurestore stage. Default value is None. - :paramtype stage: str - :return: An iterator like instance of FeaturestoreEntityVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.FeaturestoreEntityVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.FeaturestoreEntityVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_featurestore_entity_versions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - skip=skip, - tags=tags, - list_view_type=list_view_type, - page_size=page_size, - version_name=version_name, - version=version, - description=description, - created_by=created_by, - stage=stage, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.FeaturestoreEntityVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class InferencePoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`inference_pools` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, inference_pool_name: str, **kwargs: Any - ) -> _models.InferencePool: - """Get InferencePool. - - Get InferencePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :return: InferencePool. The InferencePool is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferencePool] = kwargs.pop("cls", None) - - _request = build_inference_pools_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.InferencePool, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.InferencePool, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_pools_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: _models.InferencePool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.InferencePool, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Create or update InferencePool (asynchronous). - - Create or update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: InferencePool entity to apply during operation. Is one of the following types: - InferencePool, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool or JSON or - IO[bytes] - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferencePool] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferencePool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.InferencePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InferencePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_pools_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: _models.PartialMinimalTrackedResourceWithSkuAndIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - inference_pool_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InferencePool]: - """Update InferencePool (asynchronous). - - Update InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :param body: Inference Pool entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - or JSON or IO[bytes] - :return: An instance of LROPoller that returns InferencePool. The InferencePool is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferencePool] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferencePool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.InferencePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InferencePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, inference_pool_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_pools_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, inference_pool_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete InferencePool (asynchronous). - - Delete InferencePool (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param inference_pool_name: Name of InferencePool. Required. - :type inference_pool_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - inference_pool_name=inference_pool_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> ItemPaged["_models.InferencePool"]: - """List InferencePools. - - List InferencePools. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword count: Number of inferencePools to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of InferencePool - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferencePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.InferencePool]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_pools_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.InferencePool], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class InferenceEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`inference_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.InferenceEndpoint: - """Get InferenceEndpoint. - - Get InferenceEndpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :return: InferenceEndpoint. The InferenceEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferenceEndpoint] = kwargs.pop("cls", None) - - _request = build_inference_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.InferenceEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Union[_models.InferenceEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: _models.InferenceEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - endpoint_name: str, - body: Union[_models.InferenceEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InferenceEndpoint]: - """Create or update InferenceEndpoint (asynchronous). - - Create or update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :param body: InferenceEndpoint entity to apply during operation. Is one of the following types: - InferenceEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint or JSON - or IO[bytes] - :return: An instance of LROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferenceEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.InferenceEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InferenceEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_update( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> LROPoller[_models.InferenceEndpoint]: - """Update InferenceEndpoint (asynchronous). - - Update InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :return: An instance of LROPoller that returns InferenceEndpoint. The InferenceEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferenceEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.InferenceEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InferenceEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, pool_name: str, endpoint_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete InferenceEndpoint (asynchronous). - - Delete InferenceEndpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param endpoint_name: Inference Endpoint name. Required. - :type endpoint_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> ItemPaged["_models.InferenceEndpoint"]: - """List Inference Endpoints. - - List Inference Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :keyword count: Number of InferenceEndpoint to be retrieved in a page of results. Default value - is None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of InferenceEndpoint - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.InferenceEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.InferenceEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class InferenceGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`inference_groups` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> _models.InferenceGroup: - """Get InferenceGroup. - - Get InferenceGroup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :return: InferenceGroup. The InferenceGroup is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.InferenceGroup] = kwargs.pop("cls", None) - - _request = build_inference_groups_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.InferenceGroup, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.InferenceGroup, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.InferenceGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.InferenceGroup, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Create or update InferenceGroup (asynchronous). - - Create or update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: InferenceGroup entity to apply during operation. Is one of the following types: - InferenceGroup, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup or JSON or - IO[bytes] - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferenceGroup] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceGroup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.InferenceGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InferenceGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.PartialMinimalTrackedResourceWithSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InferenceGroup]: - """Update InferenceGroup (asynchronous). - - Update InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithSku, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku or - JSON or IO[bytes] - :return: An instance of LROPoller that returns InferenceGroup. The InferenceGroup is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InferenceGroup] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.InferenceGroup, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.InferenceGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InferenceGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_inference_groups_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete InferenceGroup (asynchronous). - - Delete InferenceGroup (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> ItemPaged["_models.InferenceGroup"]: - """List Inference Groups. - - List Inference Groups. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :keyword count: Number of InferenceGroup to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of InferenceGroup - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.InferenceGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.InferenceGroup]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_groups_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.InferenceGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.DeltaModelStatusRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def get_delta_models_status_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelStatusRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DeltaModelStatusResponse: - """Retrieve status of delta models associated with the InferenceGroup and the target base model. - - Retrieve status of delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Is one of the following types: DeltaModelStatusRequest, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusRequest or - JSON or IO[bytes] - :return: DeltaModelStatusResponse. The DeltaModelStatusResponse is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelStatusResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeltaModelStatusResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_get_delta_models_status_async_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeltaModelStatusResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.DeltaModelListRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelListRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of str - :rtype: ~azure.core.paging.ItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of str - :rtype: ~azure.core.paging.ItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An iterator like instance of str - :rtype: ~azure.core.paging.ItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelListRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> ItemPaged[str]: - """List delta models associated with the InferenceGroup and the target base model. - - List delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelBaseRequest. Is one of the following types: DeltaModelListRequest, JSON, - IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelListRequest or - JSON or IO[bytes] - :return: An iterator like instance of str - :rtype: ~azure.core.paging.ItemPaged[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[str]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_groups_list_delta_models_async_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[str], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _modify_delta_models_async_initial( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelModifyRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_inference_groups_modify_delta_models_async_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: _models.DeltaModelModifyRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelModifyRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_modify_delta_models_async( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - body: Union[_models.DeltaModelModifyRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Modify delta models associated with the InferenceGroup and the target base model. - - Modify delta models associated with the InferenceGroup and the target base model. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :param body: DeltaModelModifyRequest. Is one of the following types: DeltaModelModifyRequest, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeltaModelModifyRequest or - JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._modify_delta_models_async_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_status( - self, resource_group_name: str, workspace_name: str, pool_name: str, group_name: str, **kwargs: Any - ) -> _models.GroupStatus: - """Retrieve inference group status. - - Retrieve inference group status. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :return: GroupStatus. The GroupStatus is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GroupStatus - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.GroupStatus] = kwargs.pop("cls", None) - - _request = build_inference_groups_get_status_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.GroupStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - pool_name: str, - group_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SkuResource"]: - """List Inference Group Skus. - - List Inference Group Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. Required. - :type workspace_name: str - :param pool_name: Pool name. Required. - :type pool_name: str - :param group_name: Inference Group name. Required. - :type group_name: str - :keyword count: Number of Skus to be retrieved in a page of results. Default value is None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of SkuResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SkuResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_inference_groups_list_skus_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - pool_name=pool_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - count=count, - skip=skip, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SkuResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class MarketplaceSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`marketplace_subscriptions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.MarketplaceSubscription: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: MarketplaceSubscription. The MarketplaceSubscription is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.MarketplaceSubscription] = kwargs.pop("cls", None) - - _request = build_marketplace_subscriptions_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.MarketplaceSubscription, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.MarketplaceSubscription, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_marketplace_subscriptions_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.MarketplaceSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.MarketplaceSubscription, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.MarketplaceSubscription]: - """Create or update Marketplace Subscription (asynchronous). - - Create or update Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :param body: Marketplace Subscription entity to apply during operation. Is one of the following - types: MarketplaceSubscription, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription or - JSON or IO[bytes] - :return: An instance of LROPoller that returns MarketplaceSubscription. The - MarketplaceSubscription is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MarketplaceSubscription] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.MarketplaceSubscription, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.MarketplaceSubscription].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.MarketplaceSubscription]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_marketplace_subscriptions_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> LROPoller[None]: - """Delete Marketplace Subscription (asynchronous). - - Delete Marketplace Subscription (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Container name. Required. - :type name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.MarketplaceSubscription"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of MarketplaceSubscription - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.MarketplaceSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.MarketplaceSubscription]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_marketplace_subscriptions_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.MarketplaceSubscription], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class OnlineEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`online_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.OnlineEndpoint: - """Get Online Endpoint. - - Get Online Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: OnlineEndpoint. The OnlineEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OnlineEndpoint] = kwargs.pop("cls", None) - - _request = build_online_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OnlineEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.OnlineEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.OnlineEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.OnlineEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Create or update Online Endpoint (asynchronous). - - Create or update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - OnlineEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint or JSON or - IO[bytes] - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OnlineEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OnlineEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.PartialMinimalTrackedResourceWithIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.OnlineEndpoint]: - """Update Online Endpoint (asynchronous). - - Update Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithIdentity - or JSON or IO[bytes] - :return: An instance of LROPoller that returns OnlineEndpoint. The OnlineEndpoint is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OnlineEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OnlineEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_online_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete Online Endpoint (asynchronous). - - Delete Online Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - name: Optional[str] = None, - count: Optional[int] = None, - compute_type: Optional[Union[str, _models.EndpointComputeType]] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - order_by: Optional[Union[str, _models.OrderString]] = None, - **kwargs: Any - ) -> ItemPaged["_models.OnlineEndpoint"]: - """List Online Endpoints. - - List Online Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword name: Name of the endpoint. Default value is None. - :paramtype name: str - :keyword count: Number of endpoints to be retrieved in a page of results. Default value is - None. - :paramtype count: int - :keyword compute_type: EndpointComputeType to be filtered by. Known values are: "Managed", - "Kubernetes", and "AzureMLCompute". Default value is None. - :paramtype compute_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointComputeType - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: A set of tags with which to filter the returned models. It is a comma separated - string of tags key or tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . Default value - is None. - :paramtype tags: str - :keyword properties: A set of properties with which to filter the returned models. It is a - comma separated string of properties key and/or properties key=value Example: - propKey1,propKey2,propKey3=value3 . Default value is None. - :paramtype properties: str - :keyword order_by: The option to order the response. Known values are: "CreatedAtDesc", - "CreatedAtAsc", "UpdatedAtDesc", and "UpdatedAtAsc". Default value is None. - :paramtype order_by: str or ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OrderString - :return: An iterator like instance of OnlineEndpoint - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OnlineEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_online_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - name=name, - count=count, - compute_type=compute_type, - skip=skip, - tags=tags, - properties=properties, - order_by=order_by, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OnlineEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointAuthKeys: - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: EndpointAuthKeys. The EndpointAuthKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - - _request = build_online_endpoints_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_endpoints_regenerate_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.RegenerateEndpointKeysRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param body: RegenerateKeys request . Is one of the following types: - RegenerateEndpointKeysRequest, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest or JSON - or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_token( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointAuthToken: - """Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :return: EndpointAuthToken. The EndpointAuthToken is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthToken - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthToken] = kwargs.pop("cls", None) - - _request = build_online_endpoints_get_token_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthToken, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class OnlineDeploymentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`online_deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> _models.OnlineDeployment: - """Get Inference Deployment Deployment. - - Get Inference Deployment Deployment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :return: OnlineDeployment. The OnlineDeployment is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OnlineDeployment] = kwargs.pop("cls", None) - - _request = build_online_deployments_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OnlineDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.OnlineDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_deployments_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.OnlineDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.OnlineDeployment, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Create or update Inference Endpoint Deployment (asynchronous). - - Create or update Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Inference Endpoint entity to apply during operation. Is one of the following - types: OnlineDeployment, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment or JSON or - IO[bytes] - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineDeployment] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OnlineDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OnlineDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_deployments_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.PartialMinimalTrackedResourceWithSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSku, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.OnlineDeployment]: - """Update Online Deployment (asynchronous). - - Update Online Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: Online Endpoint entity to apply during operation. Is one of the following types: - PartialMinimalTrackedResourceWithSku, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSku or - JSON or IO[bytes] - :return: An instance of LROPoller that returns OnlineDeployment. The OnlineDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OnlineDeployment] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OnlineDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OnlineDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OnlineDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_online_deployments_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete Inference Endpoint Deployment (asynchronous). - - Delete Inference Endpoint Deployment (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.OnlineDeployment"]: - """List Inference Endpoint Deployments. - - List Inference Endpoint Deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Top of list. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of OnlineDeployment - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OnlineDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OnlineDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_online_deployments_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OnlineDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: _models.DeploymentLogsRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def get_logs( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - body: Union[_models.DeploymentLogsRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.DeploymentLogs: - """Polls an Endpoint operation. - - Polls an Endpoint operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :param body: The request containing parameters for retrieving logs. Is one of the following - types: DeploymentLogsRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogsRequest or - JSON or IO[bytes] - :return: DeploymentLogs. The DeploymentLogs is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DeploymentLogs - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeploymentLogs] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_online_deployments_get_logs_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeploymentLogs, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_skus( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - deployment_name: str, - *, - count: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SkuResource"]: - """List Inference Endpoint Deployment Skus. - - List Inference Endpoint Deployment Skus. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Online Endpoint name. Required. - :type endpoint_name: str - :param deployment_name: Inference Endpoint Deployment name. Required. - :type deployment_name: str - :keyword count: Number of Skus to be retrieved in a page of results. Default value is None. - :paramtype count: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of SkuResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.SkuResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SkuResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_online_deployments_list_skus_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - count=count, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SkuResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class SchedulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`schedules` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> _models.Schedule: - """Get schedule. - - Get schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :return: Schedule. The Schedule is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) - - _request = build_schedules_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Schedule, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.Schedule, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_schedules_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.Schedule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.Schedule, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Schedule]: - """Create or update schedule. - - Create or update schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :param body: Schedule definition. Is one of the following types: Schedule, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule or JSON or - IO[bytes] - :return: An instance of LROPoller that returns Schedule. The Schedule is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Schedule, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Schedule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Schedule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_schedules_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> LROPoller[None]: - """Delete schedule. - - Delete schedule. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Schedule name. Required. - :type name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - list_view_type: Union[str, _models.ScheduleListViewType] = "EnabledOnly", - **kwargs: Any - ) -> ItemPaged["_models.Schedule"]: - """List schedules in specified workspace. - - List schedules in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: Status filter for schedule. Known values are: "EnabledOnly", - "DisabledOnly", and "All". Default value is "EnabledOnly". - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ScheduleListViewType - :return: An iterator like instance of Schedule - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Schedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Schedule]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_schedules_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Schedule], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ServerlessEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`serverless_endpoints` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.ServerlessEndpoint: - """Get Serverless Endpoint. - - Get Serverless Endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :return: ServerlessEndpoint. The ServerlessEndpoint is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ServerlessEndpoint] = kwargs.pop("cls", None) - - _request = build_serverless_endpoints_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ServerlessEndpoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ServerlessEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_serverless_endpoints_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.ServerlessEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.ServerlessEndpoint, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Create or update Serverless Endpoint (asynchronous). - - Create or update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Is one of the following - types: ServerlessEndpoint, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint or JSON - or IO[bytes] - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerlessEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ServerlessEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ServerlessEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerlessEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_serverless_endpoints_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.PartialMinimalTrackedResourceWithSkuAndIdentity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerlessEndpoint]: - """Update Serverless Endpoint (asynchronous). - - Update Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: Serverless Endpoint entity to apply during operation. Is one of the following - types: PartialMinimalTrackedResourceWithSkuAndIdentity, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PartialMinimalTrackedResourceWithSkuAndIdentity - or JSON or IO[bytes] - :return: An instance of LROPoller that returns ServerlessEndpoint. The ServerlessEndpoint is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerlessEndpoint] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ServerlessEndpoint, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ServerlessEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerlessEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_serverless_endpoints_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> LROPoller[None]: - """Delete Serverless Endpoint (asynchronous). - - Delete Serverless Endpoint (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ServerlessEndpoint"]: - """List Serverless Endpoints. - - List Serverless Endpoints. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ServerlessEndpoint - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ServerlessEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ServerlessEndpoint]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_serverless_endpoints_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ServerlessEndpoint], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_keys( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any - ) -> _models.EndpointAuthKeys: - """List EndpointAuthKeys for an Endpoint using Key-based authentication. - - List EndpointAuthKeys for an Endpoint using Key-based authentication. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :return: EndpointAuthKeys. The EndpointAuthKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - - _request = build_serverless_endpoints_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _regenerate_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_serverless_endpoints_regenerate_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: _models.RegenerateEndpointKeysRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - name: str, - body: Union[_models.RegenerateEndpointKeysRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.EndpointAuthKeys]: - """Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param name: Serverless Endpoint name. Required. - :type name: str - :param body: RegenerateKeys request . Is one of the following types: - RegenerateEndpointKeysRequest, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateEndpointKeysRequest or JSON - or IO[bytes] - :return: An instance of LROPoller that returns EndpointAuthKeys. The EndpointAuthKeys is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointAuthKeys] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointAuthKeys] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._regenerate_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointAuthKeys, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.EndpointAuthKeys].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EndpointAuthKeys]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class RaiPolicyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`rai_policy` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, rai_policy_name: str, **kwargs: Any - ) -> _models.RaiPolicyPropertiesBasicResource: - """Gets the specified Content Filters associated with the Azure OpenAI account. - - Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :return: RaiPolicyPropertiesBasicResource. The RaiPolicyPropertiesBasicResource is compatible - with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_rai_policy_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_rai_policy_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - proxy_api_version=proxy_api_version, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: _models.RaiPolicyPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Is one of the following types: RaiPolicyPropertiesBasicResource, JSON, IO[bytes] - Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource or - JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.RaiPolicyPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RaiPolicyPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_rai_policy_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - proxy_api_version=proxy_api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI account. - - Deletes the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to get a PE connection. - - Called by end-users to get a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - body: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - Called by end-users to approve or reject a PE connection. This method must validate and forward - the call to NRP. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :param body: PrivateEndpointConnection object. Is one of the following types: - PrivateEndpointConnection, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - or JSON or IO[bytes] - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_private_endpoint_connections_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> None: - """Called by end-users to delete a PE connection. - - Called by end-users to delete a PE connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param private_endpoint_connection_name: NRP Private Endpoint Connection Name. Required. - :type private_endpoint_connection_name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateEndpointConnection"]: - """Called by end-users to get all PE connections. - - Called by end-users to get all PE connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of PrivateEndpointConnection - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_private_endpoint_connections_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PrivateEndpointConnection], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ComputeOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`compute` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> _models.ComputeResource: - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: ComputeResource. The ComputeResource is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComputeResource] = kwargs.pop("cls", None) - - _request = build_compute_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComputeResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ComputeResource, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.ComputeResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ComputeResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. Is one of the following - types: ComputeResource, JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource or - JSON or IO[bytes] - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComputeResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ComputeResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ComputeResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ComputeResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ClusterUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.ClusterUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Required. - :type parameters: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClusterUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ClusterUpdateParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ComputeResource]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: Additional parameters for cluster update. Is one of the following types: - ClusterUpdateParameters, JSON, IO[bytes] Required. - :type parameters: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ClusterUpdateParameters or JSON or - IO[bytes] - :return: An instance of LROPoller that returns ComputeResource. The ComputeResource is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComputeResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = _deserialize(_models.ComputeResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ComputeResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ComputeResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - *, - underlying_resource_action: Union[str, _models.UnderlyingResourceAction], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - underlying_resource_action=underlying_resource_action, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - *, - underlying_resource_action: Union[str, _models.UnderlyingResourceAction], - **kwargs: Any - ) -> LROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :keyword underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. Known values are: "Delete" and "Detach". - Required. - :paramtype underlying_resource_action: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UnderlyingResourceAction - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ComputeResource"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ComputeResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComputeResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_compute_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComputeResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def update_custom_services( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List[_models.CustomService], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Required. - :type custom_services: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CustomService] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_custom_services( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: List[JSON], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Required. - :type custom_services: list[JSON] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_custom_services( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Required. - :type custom_services: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update_custom_services( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - custom_services: Union[List[_models.CustomService], List[JSON], IO[bytes]], - **kwargs: Any - ) -> None: - """Updates the custom services list. The list of custom services provided shall be overwritten. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param custom_services: New list of Custom Services. Is one of the following types: - [CustomService], [JSON], IO[bytes] Required. - :type custom_services: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CustomService] or list[JSON] or - IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(custom_services, (IOBase, bytes)): - _content = custom_services - else: - _content = json.dumps(custom_services, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_custom_services_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_nodes( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> ItemPaged["_models.AmlComputeNodeInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An iterator like instance of AmlComputeNodeInformation - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AmlComputeNodeInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AmlComputeNodeInformation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_compute_list_nodes_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AmlComputeNodeInformation], - deserialized.get("nodes", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_keys( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> _models.ComputeSecrets: - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: ComputeSecrets. The ComputeSecrets is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeSecrets - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComputeSecrets] = kwargs.pop("cls", None) - - _request = build_compute_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComputeSecrets, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update_data_mounts( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List[_models.ComputeInstanceDataMount], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - Required. - :type data_mounts: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceDataMount] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_data_mounts( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: List[JSON], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - Required. - :type data_mounts: list[JSON] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_data_mounts( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. - Required. - :type data_mounts: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update_data_mounts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - data_mounts: Union[List[_models.ComputeInstanceDataMount], List[JSON], IO[bytes]], - **kwargs: Any - ) -> None: - """Update Data Mounts of a Machine Learning compute. - - Update Data Mounts of a Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param data_mounts: The parameters for creating or updating a machine learning workspace. Is - one of the following types: [ComputeInstanceDataMount], [JSON], IO[bytes] Required. - :type data_mounts: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComputeInstanceDataMount] or - list[JSON] or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(data_mounts, (IOBase, bytes)): - _content = data_mounts - else: - _content = json.dumps(data_mounts, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_data_mounts_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - def _start_initial( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_start_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_start( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _stop_initial( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_stop_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_stop( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _restart_initial( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_compute_restart_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_restart( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def update_idle_shutdown_setting( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.IdleShutdownSetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdleShutdownSetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_idle_shutdown_setting( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_idle_shutdown_setting( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.IdleShutdownSetting, JSON, IO[bytes]], - **kwargs: Any - ) -> None: - """Updates the idle shutdown setting of a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. - Is one of the following types: IdleShutdownSetting, JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.IdleShutdownSetting - or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_update_idle_shutdown_setting_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get_allowed_resize_sizes( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any - ) -> _models.VirtualMachineSizeListResult: - """Returns supported virtual machine sizes for resize. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :return: VirtualMachineSizeListResult. The VirtualMachineSizeListResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSizeListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.VirtualMachineSizeListResult] = kwargs.pop("cls", None) - - _request = build_compute_get_allowed_resize_sizes_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VirtualMachineSizeListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _resize_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ResizeSchema, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_compute_resize_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: _models.ResizeSchema, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResizeSchema - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. - Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_resize( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: Union[_models.ResizeSchema, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Updates the size of a Compute Instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. Required. - :type compute_name: str - :param parameters: The object for updating VM size setting of specified Compute Instance. Is - one of the following types: ResizeSchema, JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResizeSchema or JSON - or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._resize_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class WorkspaceFeaturesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`workspace_features` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> ItemPaged["_models.AmlUserFeature"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of AmlUserFeature - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AmlUserFeature] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AmlUserFeature]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspace_features_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AmlUserFeature], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ConnectionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`connection` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get_all_models(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.EndpointModels: - """Get all models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - Get models under the Azure ML workspace for all Azure OpenAI connections that the user can - deploy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: EndpointModels. The EndpointModels is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModels - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointModels] = kwargs.pop("cls", None) - - _request = build_connection_get_all_models_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointModels, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_models( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.EndpointModelProperties"]: - """Get available models under the Azure OpenAI connection. - - Get available models under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of EndpointModelProperties - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointModelProperties]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_get_models_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointModelProperties], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_deployment( - self, resource_group_name: str, workspace_name: str, connection_name: str, deployment_name: str, **kwargs: Any - ) -> _models.EndpointDeploymentResourcePropertiesBasicResource: - """Get deployments under the Azure OpenAI connection by name. - - Get deployments under the Azure OpenAI connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :return: EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_get_deployment_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_deployment_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_create_or_update_deployment_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: _models.EndpointDeploymentResourcePropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - body: Union[_models.EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]: - """Create or update Azure OpenAI connection deployment resource with the specified parameters. - - Create or update Azure OpenAI connection deployment resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :param body: deployment object. Is one of the following types: - EndpointDeploymentResourcePropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource - or JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns - EndpointDeploymentResourcePropertiesBasicResource. The - EndpointDeploymentResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointDeploymentResourcePropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointDeploymentResourcePropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EndpointDeploymentResourcePropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_deployment_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_delete_deployment_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_deployment( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - deployment_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Delete Azure OpenAI connection deployment resource by name. - - Delete Azure OpenAI connection deployment resource by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param deployment_name: Name of the deployment resource. Required. - :type deployment_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_deployment_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - deployment_name=deployment_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_deployments( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.EndpointDeploymentResourcePropertiesBasicResource"]: - """Get all the deployments under the Azure OpenAI connection. - - Get all the deployments under the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of EndpointDeploymentResourcePropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointDeploymentResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointDeploymentResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_list_deployments_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointDeploymentResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`private_link_resources` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateLinkResource"]: - """Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, - etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - Called by Client (Portal, CLI, etc) to get available "private link resources" for the - workspace. Each "private link resource" is a connection endpoint (IP address) to the resource. - Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS - resolution. Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, - etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of PrivateLinkResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PrivateLinkResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_private_link_resources_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PrivateLinkResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ManagedNetworkProvisionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`managed_network_provisions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _provision_managed_network_initial( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.ManagedNetworkProvisionOptions, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_managed_network_provisions_provision_managed_network_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[_models.ManagedNetworkProvisionOptions] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Default - value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionOptions - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Default - value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Default - value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_provision_managed_network( - self, - resource_group_name: str, - workspace_name: str, - body: Optional[Union[_models.ManagedNetworkProvisionOptions, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkProvisionStatus]: - """Provisions the managed network of a machine learning workspace. - - Provisions the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param body: Managed Network Provisioning Options for a machine learning workspace. Is one of - the following types: ManagedNetworkProvisionOptions, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionOptions or JSON - or IO[bytes] - :return: An instance of LROPoller that returns ManagedNetworkProvisionStatus. The - ManagedNetworkProvisionStatus is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkProvisionStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.ManagedNetworkProvisionStatus] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._provision_managed_network_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedNetworkProvisionStatus, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ManagedNetworkProvisionStatus].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedNetworkProvisionStatus]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class RegistryCodeContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_code_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any) -> _models.CodeContainer: - """Get Code container. - - Get Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :return: CodeContainer. The CodeContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - - _request = build_registry_code_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: Union[_models.CodeContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_code_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: _models.CodeContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CodeContainer. The CodeContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CodeContainer. The CodeContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CodeContainer. The CodeContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - body: Union[_models.CodeContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CodeContainer]: - """Create or update Code container. - - Create or update Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param body: Container entity to create or update. Is one of the following types: - CodeContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer or JSON or - IO[bytes] - :return: An instance of LROPoller that returns CodeContainer. The CodeContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeContainer] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CodeContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CodeContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CodeContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_code_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete Code container. - - Delete Code container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.CodeContainer"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of CodeContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_code_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistryDataReferencesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_data_references` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: _models.GetBlobReferenceSASRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def get_blob_reference_sas( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.GetBlobReferenceSASRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.GetBlobReferenceSASResponseDto: - """Get blob reference SAS Uri. - - Get blob reference SAS Uri. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Data reference name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Asset id and blob uri. Is one of the following types: - GetBlobReferenceSASRequestDto, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASRequestDto or JSON - or IO[bytes] - :return: GetBlobReferenceSASResponseDto. The GetBlobReferenceSASResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.GetBlobReferenceSASResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GetBlobReferenceSASResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_references_get_blob_reference_sas_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.GetBlobReferenceSASResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RegistryCodeVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_code_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any - ) -> _models.CodeVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :return: CodeVersion. The CodeVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - - _request = build_registry_code_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CodeVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: Union[_models.CodeVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_code_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: _models.CodeVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CodeVersion. The CodeVersion is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CodeVersion. The CodeVersion is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns CodeVersion. The CodeVersion is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: Union[_models.CodeVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CodeVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: CodeVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion or JSON or - IO[bytes] - :return: An instance of LROPoller that returns CodeVersion. The CodeVersion is compatible with - MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CodeVersion] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.CodeVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CodeVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CodeVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_code_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.CodeVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of CodeVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.CodeVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CodeVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_code_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CodeVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - code_name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a code asset to. - - Generate a storage location and credential for the client to upload a code asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param code_name: Container name. Required. - :type code_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_code_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - code_name=code_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RegistryComponentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_component_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any - ) -> _models.ComponentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :return: ComponentContainer. The ComponentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - - _request = build_registry_component_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: Union[_models.ComponentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_component_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: _models.ComponentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComponentContainer. The ComponentContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComponentContainer. The ComponentContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComponentContainer. The ComponentContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - body: Union[_models.ComponentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ComponentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param body: Container entity to create or update. Is one of the following types: - ComponentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer or JSON - or IO[bytes] - :return: An instance of LROPoller that returns ComponentContainer. The ComponentContainer is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentContainer] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ComponentContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ComponentContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ComponentContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_component_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, registry_name: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ComponentContainer"]: - """List containers. - - List containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ComponentContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_component_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistryComponentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_component_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any - ) -> _models.ComponentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :return: ComponentVersion. The ComponentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - - _request = build_registry_component_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComponentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: Union[_models.ComponentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_component_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: _models.ComponentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - version: str, - body: Union[_models.ComponentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ComponentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - ComponentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion or JSON or - IO[bytes] - :return: An instance of LROPoller that returns ComponentVersion. The ComponentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ComponentVersion] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ComponentVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ComponentVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ComponentVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_component_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :param version: Version identifier. Required. - :type version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - component_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.ComponentVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param component_name: Container name. Required. - :type component_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of ComponentVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ComponentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ComponentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_component_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ComponentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistryDataContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_data_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any) -> _models.DataContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :return: DataContainer. The DataContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - - _request = build_registry_data_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: Union[_models.DataContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: _models.DataContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DataContainer. The DataContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DataContainer. The DataContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DataContainer. The DataContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - body: Union[_models.DataContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DataContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param body: Container entity to create or update. Is one of the following types: - DataContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer or JSON or - IO[bytes] - :return: An instance of LROPoller that returns DataContainer. The DataContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataContainer] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DataContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DataContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DataContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_data_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any) -> LROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.DataContainer"]: - """List Data containers. - - List Data containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_data_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistryDataVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_data_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any - ) -> _models.DataVersionBase: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: DataVersionBase. The DataVersionBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - - _request = build_registry_data_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DataVersionBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.DataVersionBase, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: _models.DataVersionBase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.DataVersionBase, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DataVersionBase]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - DataVersionBase, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase or JSON or - IO[bytes] - :return: An instance of LROPoller that returns DataVersionBase. The DataVersionBase is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataVersionBase] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DataVersionBase, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DataVersionBase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DataVersionBase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_data_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.DataVersionBase"]: - """List data versions in the data container. - - List data versions in the data container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :keyword order_by: Please choose OrderBy value from ['createdtime', 'modifiedtime']. Default - value is None. - :paramtype order_by: str - :keyword top: Top count of results, top count cannot be greater than the page size. - If topCount > page size, results with be default page size count will be returned. Default - value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, - ListViewType.All]View type for including/excluding (for example) archived entities. Known - values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of DataVersionBase - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.DataVersionBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DataVersionBase]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_data_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DataVersionBase], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a data asset to. - - Generate a storage location and credential for the client to upload a data asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param name: Container name. Required. - :type name: str - :param version: Version identifier. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_data_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - name=name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RegistryEnvironmentContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_environment_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any - ) -> _models.EnvironmentContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :return: EnvironmentContainer. The EnvironmentContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - - _request = build_registry_environment_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: Union[_models.EnvironmentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_environment_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: _models.EnvironmentContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EnvironmentContainer. The EnvironmentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EnvironmentContainer. The EnvironmentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EnvironmentContainer. The EnvironmentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - body: Union[_models.EnvironmentContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.EnvironmentContainer]: - """Create or update container. - - Create or update container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param body: Container entity to create or update. Is one of the following types: - EnvironmentContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer or - JSON or IO[bytes] - :return: An instance of LROPoller that returns EnvironmentContainer. The EnvironmentContainer - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentContainer] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EnvironmentContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.EnvironmentContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EnvironmentContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_environment_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.EnvironmentContainer"]: - """List environment containers. - - List environment containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_environment_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistryEnvironmentVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_environment_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any - ) -> _models.EnvironmentVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: EnvironmentVersion. The EnvironmentVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - - _request = build_registry_environment_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: Union[_models.EnvironmentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_environment_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: _models.EnvironmentVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EnvironmentVersion. The EnvironmentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EnvironmentVersion. The EnvironmentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EnvironmentVersion. The EnvironmentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - version: str, - body: Union[_models.EnvironmentVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.EnvironmentVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: - EnvironmentVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion or JSON - or IO[bytes] - :return: An instance of LROPoller that returns EnvironmentVersion. The EnvironmentVersion is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EnvironmentVersion] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EnvironmentVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.EnvironmentVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EnvironmentVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_environment_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - environment_name: str, - *, - order_by: Optional[str] = None, - top: Optional[int] = None, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.EnvironmentVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param environment_name: Container name. This is case-sensitive. Required. - :type environment_name: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of EnvironmentVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EnvironmentVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnvironmentVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_environment_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EnvironmentVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistryModelContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_model_containers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any - ) -> _models.ModelContainer: - """Get container. - - Get container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :return: ModelContainer. The ModelContainer is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - - _request = build_registry_model_containers_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelContainer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: Union[_models.ModelContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_model_containers_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: _models.ModelContainer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ModelContainer. The ModelContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ModelContainer. The ModelContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ModelContainer. The ModelContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - body: Union[_models.ModelContainer, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ModelContainer]: - """Create or update model container. - - Create or update model container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param body: Container entity to create or update. Is one of the following types: - ModelContainer, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer or JSON or - IO[bytes] - :return: An instance of LROPoller that returns ModelContainer. The ModelContainer is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelContainer] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ModelContainer, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ModelContainer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ModelContainer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_model_containers_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete container. - - Delete container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - *, - skip: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ModelContainer"]: - """List model containers. - - List model containers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelContainer - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelContainer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelContainer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_model_containers_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - subscription_id=self._config.subscription_id, - skip=skip, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelContainer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RegistryModelVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`registry_model_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any - ) -> _models.ModelVersion: - """Get version. - - Get version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: ModelVersion. The ModelVersion is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - - _request = build_registry_model_versions_get_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ModelVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: Union[_models.ModelVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_model_versions_create_or_update_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: _models.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ModelVersion. The ModelVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ModelVersion. The ModelVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ModelVersion. The ModelVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: Union[_models.ModelVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ModelVersion]: - """Create or update version. - - Create or update version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Version entity to create or update. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion or JSON or - IO[bytes] - :return: An instance of LROPoller that returns ModelVersion. The ModelVersion is compatible - with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ModelVersion] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ModelVersion, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ModelVersion].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ModelVersion]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_registry_model_versions_delete_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete version. - - Delete version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - *, - skip: Optional[str] = None, - order_by: Optional[str] = None, - top: Optional[int] = None, - version: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[str] = None, - properties: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ModelVersion"]: - """List versions. - - List versions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword order_by: Ordering of list. Default value is None. - :paramtype order_by: str - :keyword top: Maximum number of records to return. Default value is None. - :paramtype top: int - :keyword version: Version identifier. Default value is None. - :paramtype version: str - :keyword description: Model description. Default value is None. - :paramtype description: str - :keyword tags: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. Default value is None. - :paramtype tags: str - :keyword properties: Comma-separated list of property names (and optionally values). Example: - prop1,prop2=value2. Default value is None. - :paramtype properties: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :return: An iterator like instance of ModelVersion - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ModelVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ModelVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_registry_model_versions_list_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - subscription_id=self._config.subscription_id, - skip=skip, - order_by=order_by, - top=top, - version=version, - description=description, - tags=tags, - properties=properties, - list_view_type=list_view_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ModelVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: _models.PendingUploadRequestDto, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_get_start_pending_upload( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: Union[_models.PendingUploadRequestDto, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponseDto: - """Generate a storage location and credential for the client to upload a model asset to. - - Generate a storage location and credential for the client to upload a model asset to. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param registry_name: Name of Azure Machine Learning registry. This is case-insensitive. - Required. - :type registry_name: str - :param model_name: Container name. This is case-sensitive. Required. - :type model_name: str - :param version: Version identifier. This is case-sensitive. Required. - :type version: str - :param body: Pending upload request object. Is one of the following types: - PendingUploadRequestDto, JSON, IO[bytes] Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadRequestDto or - JSON or IO[bytes] - :return: PendingUploadResponseDto. The PendingUploadResponseDto is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.PendingUploadResponseDto - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponseDto] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_registry_model_versions_create_or_get_start_pending_upload_request( - resource_group_name=resource_group_name, - registry_name=registry_name, - model_name=model_name, - version=version, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PendingUploadResponseDto, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`jobs` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any) -> _models.JobBase: - """Gets a Job by name/id. - - Gets a Job by name/id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.JobBase] = kwargs.pop("cls", None) - - _request = build_jobs_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.JobBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: _models.JobBase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: Union[_models.JobBase, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.JobBase: - """Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - Creates and executes a Job. For update case, the Tags in the definition passed in will replace - Tags in the existing job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :param body: Job definition object. Is one of the following types: JobBase, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase or JSON or - IO[bytes] - :return: JobBase. The JobBase is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobBase] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_jobs_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.JobBase, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial(self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_jobs_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Job (asynchronous). - - Deletes a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - skip: Optional[str] = None, - job_type: Optional[str] = None, - tag: Optional[str] = None, - list_view_type: Optional[Union[str, _models.ListViewType]] = None, - properties: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.JobBase"]: - """Lists Jobs in the workspace. - - Lists Jobs in the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword job_type: Type of job to be returned. Default value is None. - :paramtype job_type: str - :keyword tag: Jobs returned will have this tag key. Default value is None. - :paramtype tag: str - :keyword list_view_type: View type for including/excluding (for example) archived entities. - Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ListViewType - :keyword properties: Comma-separated list of user property names (and optionally values). - Example: prop1,prop2=value2. Default value is None. - :paramtype properties: str - :return: An iterator like instance of JobBase - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.JobBase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.JobBase]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_jobs_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - properties=properties, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.JobBase], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _cancel_initial(self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_jobs_cancel_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_cancel(self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any) -> LROPoller[None]: - """Cancels a Job (asynchronous). - - Cancels a Job (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param id: The name and identifier for the Job. This is case-sensitive. Required. - :type id: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._cancel_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class WorkspaceConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`workspace_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Lists machine learning workspaces connections by name. - - Lists machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - _request = build_workspace_connections_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[_models.WorkspaceConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Default value is - None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Default value is - None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Default value is - None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Create or update machine learning workspaces connections under the specified workspace. - - Create or update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: The object for creating or updating a new workspace connection. Is one of the - following types: WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes] Default value is - None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - or JSON or IO[bytes] - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspace_connections_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[_models.WorkspaceConnectionUpdateParameter] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionUpdateParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionUpdateParameter, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """Update machine learning workspaces connections under the specified workspace. - - Update machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Parameters for workspace connection update. Is one of the following types: - WorkspaceConnectionUpdateParameter, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionUpdateParameter or - JSON or IO[bytes] - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspace_connections_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any - ) -> None: - """Delete machine learning workspaces connections by name. - - Delete machine learning workspaces connections by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_workspace_connections_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: bool = False, - **kwargs: Any - ) -> ItemPaged["_models.WorkspaceConnectionPropertiesV2BasicResource"]: - """List all the available machine learning workspaces connections under the specified workspace. - - Lists all the available machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword target: Target of the workspace connection. Default value is None. - :paramtype target: str - :keyword category: Category of the workspace connection. Default value is None. - :paramtype category: str - :keyword include_all: query parameter that indicates if get connection call should return both - connections and datastores. Default value is False. - :paramtype include_all: bool - :return: An iterator like instance of WorkspaceConnectionPropertiesV2BasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.WorkspaceConnectionPropertiesV2BasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_workspace_connections_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - target=target, - category=category, - include_all=include_all, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.WorkspaceConnectionPropertiesV2BasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_secrets( - self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any - ) -> _models.WorkspaceConnectionPropertiesV2BasicResource: - """List all the secrets of a machine learning workspaces connections. - - List all the secrets of a machine learning workspaces connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :return: WorkspaceConnectionPropertiesV2BasicResource. The - WorkspaceConnectionPropertiesV2BasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.WorkspaceConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - _request = build_workspace_connections_list_secrets_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.WorkspaceConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _test_connection_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_workspace_connections_test_connection_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[_models.WorkspaceConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_test_connection( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - body: Optional[Union[_models.WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Test machine learning workspaces connections under the specified workspace. - - Test machine learning workspaces connections under the specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param body: Workspace Connection object. Is one of the following types: - WorkspaceConnectionPropertiesV2BasicResource, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.WorkspaceConnectionPropertiesV2BasicResource - or JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._test_connection_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiBlocklistOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklist` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - **kwargs: Any - ) -> _models.RaiBlocklistPropertiesBasicResource: - """Gets the specified custom blocklist associated with the Azure OpenAI connection. - - Gets the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :return: RaiBlocklistPropertiesBasicResource. The RaiBlocklistPropertiesBasicResource is - compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiBlocklistPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBlocklistPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[_models.RaiBlocklistPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: _models.RaiBlocklistPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[_models.RaiBlocklistPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistPropertiesBasicResource]: - """Update the state of specified blocklist associated with the Azure OpenAI connection. - - Update the state of specified blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Is one of the following types: RaiBlocklistPropertiesBasicResource, JSON, - IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource or - JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns RaiBlocklistPropertiesBasicResource. The - RaiBlocklistPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiBlocklistPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiBlocklistPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.RaiBlocklistPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RaiBlocklistPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiBlocklistsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklists` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.RaiBlocklistPropertiesBasicResource"]: - """Gets the custom blocklists associated with the Azure OpenAI connection. - - Gets the custom blocklists associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiBlocklistPropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiBlocklistPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_rai_blocklists_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiBlocklistPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ConnectionRaiBlocklistItemOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklist_item` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _add_bulk_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[_models.RaiBlocklistItemBulkRequest], List[JSON], IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_item_add_bulk_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List[_models.RaiBlocklistItemBulkRequest], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Required. - :type body: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemBulkRequest] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns list of RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.LROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List[JSON], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Required. - :type body: list[JSON] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns list of RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.LROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns list of RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.LROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_add_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[_models.RaiBlocklistItemBulkRequest], List[JSON], IO[bytes]], - **kwargs: Any - ) -> LROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]: - """Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: Properties describing the custom blocklist items. Is one of the following types: - [RaiBlocklistItemBulkRequest], [JSON], IO[bytes] Required. - :type body: - list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemBulkRequest] or - list[JSON] or IO[bytes] - :return: An instance of LROPoller that returns list of RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.polling.LROPoller[list[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[_models.RaiBlocklistItemPropertiesBasicResource]] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._add_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = _deserialize(List[_models.RaiBlocklistItemPropertiesBasicResource], response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[List[_models.RaiBlocklistItemPropertiesBasicResource]]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_bulk_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[str], IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_item_delete_bulk_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_delete_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: List[str], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. Required. - :type body: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_delete_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_delete_bulk( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - body: Union[List[str], IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI - connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param body: List of RAI Blocklist Items Names. Is either a [str] type or a IO[bytes] type. - Required. - :type body: list[str] or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_bulk_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> _models.RaiBlocklistItemPropertiesBasicResource: - """Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - Gets the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :return: RaiBlocklistItemPropertiesBasicResource. The RaiBlocklistItemPropertiesBasicResource - is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiBlocklistItemPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_item_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBlocklistItemPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: Union[_models.RaiBlocklistItemPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_blocklist_item_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: _models.RaiBlocklistItemPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiBlocklistItemPropertiesBasicResource. The - RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiBlocklistItemPropertiesBasicResource. The - RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiBlocklistItemPropertiesBasicResource. The - RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - body: Union[_models.RaiBlocklistItemPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.RaiBlocklistItemPropertiesBasicResource]: - """Update the state of specified blocklist item associated with the Azure OpenAI connection. - - Update the state of specified blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :param body: Is one of the following types: RaiBlocklistItemPropertiesBasicResource, JSON, - IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource - or JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns RaiBlocklistItemPropertiesBasicResource. The - RaiBlocklistItemPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiBlocklistItemPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiBlocklistItemPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.RaiBlocklistItemPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RaiBlocklistItemPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_rai_blocklist_item_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - Deletes the specified custom blocklist item associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: Name of the RaiBlocklist Item. Required. - :type rai_blocklist_item_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiBlocklistItemsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_blocklist_items` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_blocklist_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.RaiBlocklistItemPropertiesBasicResource"]: - """Gets the custom blocklist items associated with the Azure OpenAI connection. - - Gets the custom blocklist items associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_blocklist_name: The name of the RaiBlocklist. Required. - :type rai_blocklist_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiBlocklistItemPropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiBlocklistItemPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiBlocklistItemPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_rai_blocklist_items_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiBlocklistItemPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ConnectionRaiPolicyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_policy` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, connection_name: str, rai_policy_name: str, **kwargs: Any - ) -> _models.RaiPolicyPropertiesBasicResource: - """Gets the specified Content Filters associated with the Azure OpenAI connection. - - Gets the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :return: RaiPolicyPropertiesBasicResource. The RaiPolicyPropertiesBasicResource is compatible - with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_connection_rai_policy_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_connection_rai_policy_create_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: _models.RaiPolicyPropertiesBasicResource, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: JSON, - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: JSON - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: IO[bytes], - *, - proxy_api_version: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Required. - :type body: IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - body: Union[_models.RaiPolicyPropertiesBasicResource, JSON, IO[bytes]], - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.RaiPolicyPropertiesBasicResource]: - """Update the state of specified Content Filters associated with the Azure OpenAI connection. - - Update the state of specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :param body: Is one of the following types: RaiPolicyPropertiesBasicResource, JSON, IO[bytes] - Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource or - JSON or IO[bytes] - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns RaiPolicyPropertiesBasicResource. The - RaiPolicyPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiPolicyPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - body=body, - proxy_api_version=proxy_api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.RaiPolicyPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.RaiPolicyPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RaiPolicyPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_connection_rai_policy_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - rai_policy_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI connection. - - Deletes the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :param rai_policy_name: Name of the Rai Policy. Required. - :type rai_policy_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - rai_policy_name=rai_policy_name, - proxy_api_version=proxy_api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ConnectionRaiPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`connection_rai_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.RaiPolicyPropertiesBasicResource"]: - """List the specified Content Filters associated with the Azure OpenAI connection. - - List the specified Content Filters associated with the Azure OpenAI connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. Required. - :type connection_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiPolicyPropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiPolicyPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_connection_rai_policies_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiPolicyPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RaiPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`rai_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - *, - proxy_api_version: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.RaiPolicyPropertiesBasicResource"]: - """List the specified Content Filters associated with the Azure OpenAI account. - - List the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :keyword proxy_api_version: Api version used by proxy call. Default value is None. - :paramtype proxy_api_version: str - :return: An iterator like instance of RaiPolicyPropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RaiPolicyPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiPolicyPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_policies_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - proxy_api_version=proxy_api_version, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiPolicyPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class EndpointOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`endpoint` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointResourcePropertiesBasicResource: - """Get endpoint resource. - - Gets endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: EndpointResourcePropertiesBasicResource. The EndpointResourcePropertiesBasicResource - is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointResourcePropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_endpoint_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointResourcePropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.EndpointResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_endpoint_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.EndpointResourcePropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EndpointResourcePropertiesBasicResource. The - EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EndpointResourcePropertiesBasicResource. The - EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EndpointResourcePropertiesBasicResource. The - EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.EndpointResourcePropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.EndpointResourcePropertiesBasicResource]: - """Create or update endpoint resource with the specified parameters. - - Create or update endpoint resource with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Endpoint resource object. Is one of the following types: - EndpointResourcePropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of LROPoller that returns EndpointResourcePropertiesBasicResource. The - EndpointResourcePropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EndpointResourcePropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EndpointResourcePropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.EndpointResourcePropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EndpointResourcePropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - *, - endpoint_type: Optional[Union[str, _models.EndpointType]] = None, - include_online_endpoints: bool = False, - include_serverless_endpoints: bool = False, - include_connections: bool = False, - skip: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.EndpointResourcePropertiesBasicResource"]: - """List All the endpoints under this workspace. - - List All the endpoints under this workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :keyword endpoint_type: Endpoint type filter. Known values are: "Azure.OpenAI", "Azure.Speech", - "Azure.ContentSafety", "Azure.Llama", "managedOnlineEndpoint", and "serverlessEndpoint". - Default value is None. - :paramtype endpoint_type: str or - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointType - :keyword include_online_endpoints: Default value is False. - :paramtype include_online_endpoints: bool - :keyword include_serverless_endpoints: Default value is False. - :paramtype include_serverless_endpoints: bool - :keyword include_connections: Default value is False. - :paramtype include_connections: bool - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :keyword expand: Whether the endpoint resource will be expand to include deployment - information, e.g. $expand=deployments. Default value is None. - :paramtype expand: str - :return: An iterator like instance of EndpointResourcePropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointResourcePropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointResourcePropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - endpoint_type=endpoint_type, - include_online_endpoints=include_online_endpoints, - include_serverless_endpoints=include_serverless_endpoints, - include_connections=include_connections, - skip=skip, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointResourcePropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> _models.EndpointKeys: - """List keys for the endpoint resource. - - List keys for the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: EndpointKeys. The EndpointKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EndpointKeys] = kwargs.pop("cls", None) - - _request = build_endpoint_list_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EndpointKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_models( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any - ) -> ItemPaged["_models.EndpointModelProperties"]: - """Get available models under the endpoint resource. - - Get available models under the endpoint resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :return: An iterator like instance of EndpointModelProperties - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.EndpointModelProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EndpointModelProperties]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_endpoint_get_models_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EndpointModelProperties], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: _models.RegenerateServiceAccountKeyContent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateServiceAccountKeyContent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def regenerate_keys( - self, - resource_group_name: str, - workspace_name: str, - endpoint_name: str, - body: Union[_models.RegenerateServiceAccountKeyContent, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.AccountApiKeys: - """Regenerate account keys. - - Regenerate account keys. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param endpoint_name: Name of the endpoint resource. Required. - :type endpoint_name: str - :param body: Is one of the following types: RegenerateServiceAccountKeyContent, JSON, IO[bytes] - Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.RegenerateServiceAccountKeyContent or - JSON or IO[bytes] - :return: AccountApiKeys. The AccountApiKeys is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AccountApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccountApiKeys] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_endpoint_regenerate_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - endpoint_name=endpoint_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AccountApiKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ManagedNetworkSettingsRuleOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`managed_network_settings_rule` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, rule_name: str, **kwargs: Any - ) -> _models.OutboundRuleBasicResource: - """Gets an outbound rule from the managed network of a machine learning workspace. - - Gets an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: OutboundRuleBasicResource. The OutboundRuleBasicResource is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - - _request = build_managed_network_settings_rule_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_managed_network_settings_rule_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: _models.OutboundRuleBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Creates or updates an outbound rule in the managed network of a machine learning workspace. - - Creates or updates an outbound rule in the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. Is one of the following types: OutboundRuleBasicResource, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - or JSON or IO[bytes] - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OutboundRuleBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OutboundRuleBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, rule_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_managed_network_settings_rule_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, rule_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an outbound rule from the managed network of a machine learning workspace. - - Deletes an outbound rule from the managed network of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - rule_name=rule_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> ItemPaged["_models.OutboundRuleBasicResource"]: - """Lists the managed network outbound rules for a machine learning workspace. - - Lists the managed network outbound rules for a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of OutboundRuleBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OutboundRuleBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_managed_network_settings_rule_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OutboundRuleBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class OutboundRuleOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`outbound_rule` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, rule_name: str, **kwargs: Any - ) -> _models.OutboundRuleBasicResource: - """The GET API for retrieveing a single outbound rule of the managed network associated with the - machine learning workspace. - - The GET API for retrieveing a single outbound rule of the managed network associated with the - machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: OutboundRuleBasicResource. The OutboundRuleBasicResource is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - - _request = build_outbound_rule_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_outbound_rule_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: _models.OutboundRuleBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - rule_name: str, - body: Union[_models.OutboundRuleBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.OutboundRuleBasicResource]: - """Create a OutboundRuleBasicResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :param body: Is one of the following types: OutboundRuleBasicResource, JSON, IO[bytes] - Required. - :type body: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource - or JSON or IO[bytes] - :return: An instance of LROPoller that returns OutboundRuleBasicResource. The - OutboundRuleBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OutboundRuleBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.OutboundRuleBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OutboundRuleBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OutboundRuleBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, rule_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_outbound_rule_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, rule_name: str, **kwargs: Any - ) -> LROPoller[None]: - """The DELETE API for deleting a single outbound rule of the managed network associated with the - machine learning workspace. - - The DELETE API for deleting a single outbound rule of the managed network associated with the - machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param rule_name: Name of the workspace managed network outbound rule. Required. - :type rule_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - rule_name=rule_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, **kwargs: Any - ) -> ItemPaged["_models.OutboundRuleBasicResource"]: - """The GET API for retrieveing the list of outbound rules of the managed network associated with - the machine learning workspace. - - The GET API for retrieveing the list of outbound rules of the managed network associated with - the machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :return: An iterator like instance of OutboundRuleBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OutboundRuleBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_outbound_rule_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OutboundRuleBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ManagedNetworkSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`managed_network_settings` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, workspace_name: str, managed_network_name: str, **kwargs: Any - ) -> _models.ManagedNetworkSettingsPropertiesBasicResource: - """Get the managed network settings for a machine learning workspace. - - Get API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :return: ManagedNetworkSettingsPropertiesBasicResource. The - ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ManagedNetworkSettingsPropertiesBasicResource] = kwargs.pop("cls", None) - - _request = build_managed_network_settings_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ManagedNetworkSettingsPropertiesBasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _put_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_managed_network_settings_put_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: _models.ManagedNetworkSettingsPropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_put( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """PUT API for managed network settings of a machine learning workspace. - - PUT API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Is one of the following - types: ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedNetworkSettingsPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._put_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedNetworkSettingsPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _patch_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if body else None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_managed_network_settings_patch_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[_models.ManagedNetworkSettingsPropertiesBasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[JSON] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Default value is None. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_patch( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Optional[Union[_models.ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]: - """Patch API for managed network settings of a machine learning workspace. - - Patch API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Is one of the following - types: ManagedNetworkSettingsPropertiesBasicResource, JSON, IO[bytes] Default value is None. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource - or JSON or IO[bytes] - :return: An instance of LROPoller that returns ManagedNetworkSettingsPropertiesBasicResource. - The ManagedNetworkSettingsPropertiesBasicResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if body else None - cls: ClsType[_models.ManagedNetworkSettingsPropertiesBasicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._patch_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedNetworkSettingsPropertiesBasicResource, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedNetworkSettingsPropertiesBasicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list( - self, resource_group_name: str, workspace_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedNetworkSettingsPropertiesBasicResource"]: - """List the managed network settings for a machine learning workspace. - - List API for managed network settings of a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :return: An iterator like instance of ManagedNetworkSettingsPropertiesBasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsPropertiesBasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ManagedNetworkSettingsPropertiesBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_managed_network_settings_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ManagedNetworkSettingsPropertiesBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class OutboundRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`outbound_rules` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _post_initial( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_outbound_rules_post_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: _models.ManagedNetworkSettingsBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsBasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_post( - self, - resource_group_name: str, - workspace_name: str, - managed_network_name: str, - body: Union[_models.ManagedNetworkSettingsBasicResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[ItemPaged["_models.OutboundRuleBasicResource"]]: - """The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - The POST API for updating the outbound rules of the managed network associated with the machine - learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param workspace_name: Azure Machine Learning Workspace Name. Required. - :type workspace_name: str - :param managed_network_name: Name of the managedNetwork associated with the workspace. Only - 'default' is supported. Required. - :type managed_network_name: str - :param body: The Managed Network Settings object of the workspace. Is one of the following - types: ManagedNetworkSettingsBasicResource, JSON, IO[bytes] Required. - :type body: - ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ManagedNetworkSettingsBasicResource or - JSON or IO[bytes] - :return: An instance of LROPoller that returns an iterator like instance of list of - OutboundRuleBasicResource - :rtype: - ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.OutboundRuleBasicResource]] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[_models.OutboundRuleBasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(next_link=None): - if not next_link: - - _request = build_outbound_rules_post_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OutboundRuleBasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._post_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - managed_network_name=managed_network_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - def internal_get_next(next_link=None): - if next_link is None: - return pipeline_response - return get_next(next_link) - - return ItemPaged(internal_get_next, extract_data) - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[ItemPaged["_models.OutboundRuleBasicResource"]].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[ItemPaged["_models.OutboundRuleBasicResource"]]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class UsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`usages` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.Usage"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location name. Required. - :type location: str - :return: An iterator like instance of Usage - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.Usage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Usage]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_usages_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Usage], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class VirtualMachineSizesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`virtual_machine_sizes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, location: str, **kwargs: Any) -> _models.VirtualMachineSizeListResult: - """Returns supported VM Sizes in a location. - - :param location: The location name. Required. - :type location: str - :return: VirtualMachineSizeListResult. The VirtualMachineSizeListResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.VirtualMachineSizeListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.VirtualMachineSizeListResult] = kwargs.pop("cls", None) - - _request = build_virtual_machine_sizes_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VirtualMachineSizeListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class QuotasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`quotas` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def update( - self, - location: str, - parameters: _models.QuotaUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, location: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Required. - :type parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, location: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, location: str, parameters: Union[_models.QuotaUpdateParameters, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UpdateWorkspaceQuotasResult: - """Update quota for each VM family in workspace. - - :param location: The location name. Required. - :type location: str - :param parameters: The request body. Is one of the following types: QuotaUpdateParameters, - JSON, IO[bytes] Required. - :type parameters: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.QuotaUpdateParameters - or JSON or IO[bytes] - :return: UpdateWorkspaceQuotasResult. The UpdateWorkspaceQuotasResult is compatible with - MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UpdateWorkspaceQuotasResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateWorkspaceQuotasResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_quotas_update_request( - location=location, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.UpdateWorkspaceQuotasResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.ResourceQuota"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location name. Required. - :type location: str - :return: An iterator like instance of ResourceQuota - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.ResourceQuota] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ResourceQuota]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_quotas_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ResourceQuota], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class PTUQuotaOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.ml._restclient.v2024_10_01_preview_tsp.MachineLearningServicesMgmtClient`'s - :attr:`ptu_quota` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MachineLearningServicesMgmtClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_available( - self, location: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.AvailableQuota"]: - """List available MaaS PTU quota. - - List available MaaS PTU quota. - - :param location: The location name. Required. - :type location: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of AvailableQuota - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AvailableQuota] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AvailableQuota]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_ptu_quota_list_available_request( - location=location, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AvailableQuota], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_available(self, location: str, **kwargs: Any) -> _models.AvailableQuota: - """Get available MaaS PTU quota. - - Get available MaaS PTU quota. - - :param location: The location name. Required. - :type location: str - :return: AvailableQuota. The AvailableQuota is compatible with MutableMapping - :rtype: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.AvailableQuota - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AvailableQuota] = kwargs.pop("cls", None) - - _request = build_ptu_quota_get_available_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AvailableQuota, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, location: str, *, skip: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.UsageAndQuotaDetails"]: - """List MaaS PTU usage and quota. - - List MaaS PTU usage and quota. - - :param location: The location name. Required. - :type location: str - :keyword skip: Continuation token for pagination. Default value is None. - :paramtype skip: str - :return: An iterator like instance of UsageAndQuotaDetails - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models.UsageAndQuotaDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.UsageAndQuotaDetails]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_ptu_quota_list_request( - location=location, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.UsageAndQuotaDetails], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_patch.py deleted file mode 100644 index ea765788358a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/tsp-location.yaml b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/tsp-location.yaml deleted file mode 100644 index c5ce8071ffcb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview_tsp/tsp-location.yaml +++ /dev/null @@ -1,4 +0,0 @@ -directory: specification/machinelearningservices/MachineLearningServices.Management -commit: a6887d2260f26285d4b1f5fba97da370be9200b4 -repo: Azure/azure-rest-api-specs -additionalDirectories: [] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_workspace_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_workspace_utils.py index fc6a31579f9f..e75dab47e489 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_workspace_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_workspace_utils.py @@ -5,6 +5,7 @@ import logging import random import uuid +from typing import Any from azure.ai.ml._azure_environments import _get_base_url_from_metadata, _resource_to_scopes from azure.ai.ml._vendor.azure_resources._resource_management_client import ResourceManagementClient @@ -15,6 +16,52 @@ module_logger = logging.getLogger(__name__) +# ------------------------------------------------------------------------------------------------ +# THROWAWAY SHIM (remove once the shared arm_ml_service client declares these workspace properties). +# +# allowRoleAssignmentOnRG and networkAcls are valid on the 2024-10-01-preview wire contract but were +# marked @removed at api-version 2025-12-01 in the TypeSpec. The shared arm_ml_service client is +# generated at 2025-12-01, so its Workspace / WorkspaceUpdateParameters hybrid models do not declare +# these properties and reject them as constructor kwargs. The hybrid models flatten everything under a +# `properties` envelope on the wire, so we round-trip the removed properties through that envelope. +# ------------------------------------------------------------------------------------------------ +def set_removed_workspace_property(rest_obj: Any, wire_key: str, value: Any) -> None: + """Place a property the arm_ml_service model no longer declares onto the flattened wire envelope. + + :param rest_obj: A hybrid arm_ml_service Workspace / WorkspaceUpdateParameters model. + :type rest_obj: Any + :param wire_key: The camelCase wire key (e.g. "allowRoleAssignmentOnRG", "networkAcls"). + :type wire_key: str + :param value: The value to serialize. Nested models must already be converted via ``as_dict()``. + :type value: Any + """ + if value is None: + return + properties = rest_obj.get("properties") or {} + properties[wire_key] = value + rest_obj["properties"] = properties + + +def get_removed_workspace_property(rest_obj: Any, wire_key: str) -> Any: + """Read a property the arm_ml_service model no longer declares from the flattened wire envelope. + + :param rest_obj: A hybrid arm_ml_service Workspace model. + :type rest_obj: Any + :param wire_key: The camelCase wire key (e.g. "allowRoleAssignmentOnRG", "networkAcls"). + :type wire_key: str + :return: The raw value from the wire envelope, or None if absent. + :rtype: Any + """ + getter = getattr(rest_obj, "get", None) + if not callable(getter): + return None + properties = rest_obj.get("properties") + if not properties: + return None + return properties.get(wire_key) + + + def get_name_for_dependent_resource(workspace_name: str, resource_type: str) -> str: alphabets_str = "" for char in workspace_name.lower(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py index 6fc2146da025..c6eacec370bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/utils.py @@ -7,7 +7,7 @@ from typing import Any, Optional, Union, cast from azure.ai.ml._restclient.v2023_04_01_preview import models -from azure.ai.ml._restclient.v2024_10_01_preview_tsp import models as models2024 +from azure.ai.ml._restclient.arm_ml_service import models as models2024 from azure.ai.ml.entities._credentials import ( AccountKeyConfiguration, CertificateConfiguration, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py index b79752c4a9c5..3d6f65357017 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py @@ -9,7 +9,7 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import Workspace as RestWorkspace +from azure.ai.ml._restclient.arm_ml_service.models import Workspace as RestWorkspace from azure.ai.ml._schema._feature_store.feature_store_schema import FeatureStoreSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, WorkspaceKind from azure.ai.ml.entities._credentials import IdentityConfiguration, ManagedIdentityConfiguration diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py index 19445f2d876e..438e5b7fd410 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py @@ -6,7 +6,7 @@ from typing import Any, Dict -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ModelProvider as RestModelProvider, CustomModelFineTuning as RestCustomModelFineTuningVertical, FineTuningJob as RestFineTuningJob, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_job.py index 4792da6d9a18..c495f12488de 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_job.py @@ -8,7 +8,7 @@ from azure.ai.ml.entities._job.job import Job from azure.ai.ml.entities._job.job_io_mixin import JobIOMixin -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ModelProvider as RestModelProvider, JobBase as RestJobBase, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_vertical.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_vertical.py index 9c11465b8c48..ebbb8cf52890 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_vertical.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/finetuning_vertical.py @@ -5,7 +5,7 @@ from typing import Any, Optional, cast from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ModelProvider as RestModelProvider, FineTuningVertical as RestFineTuningVertical, UriFileJobInput, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resources.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resources.py index 1e463dafdb83..26e34fc37730 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resources.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_resources.py @@ -4,7 +4,7 @@ from typing import Any, List from azure.ai.ml.entities._mixins import RestTranslatableMixin -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import JobResources as RestJobResources +from azure.ai.ml._restclient.arm_ml_service.models import JobResources as RestJobResources class JobResources(RestTranslatableMixin): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py index 8a6f0465c22e..763064aed924 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py @@ -137,7 +137,7 @@ def _from_rest_object(cls, rest_obj: RestCapabilityHost) -> "CapabilityHost": :param cls: Indicates that this is a class method. :type cls: class :param rest_obj: The REST object to convert. - :type rest_obj: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp.models._models_py3.CapabilityHost + :type rest_obj: ~azure.ai.ml._restclient.arm_ml_service.models.CapabilityHost :return: CapabilityHost object. :rtype: ~azure.ai.ml.entities._workspace._ai_workspaces.capability_host.CapabilityHost """ @@ -161,7 +161,7 @@ def _to_rest_object(self) -> RestCapabilityHost: Convert the CapabilityHost instance to a RestCapabilityHost object. :return: A RestCapabilityHost object representing the capability host for a Hub or Project workspace. - :rtype: azure.ai.ml._restclient.v2024_10_01_preview_tsp.models._models_py3.CapabilityHost + :rtype: azure.ai.ml._restclient.arm_ml_service.models.CapabilityHost """ properties = RestCapabilityHostProperties( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/hub.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/hub.py index 607c04ffca13..660be90a8b3b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/hub.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/hub.py @@ -4,8 +4,8 @@ from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import Workspace as RestWorkspace -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import WorkspaceHubConfig as RestWorkspaceHubConfig +from azure.ai.ml._restclient.arm_ml_service.models import Workspace as RestWorkspace +from azure.ai.ml._restclient.arm_ml_service.models import WorkspaceHubConfig as RestWorkspaceHubConfig from azure.ai.ml._schema.workspace import HubSchema from azure.ai.ml.constants._common import WorkspaceKind from azure.ai.ml.entities._credentials import IdentityConfiguration diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/diagnose.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/diagnose.py index 2a4df961f715..8c3eedcd9b9d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/diagnose.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/diagnose.py @@ -5,15 +5,15 @@ import json from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( DiagnoseRequestProperties as RestDiagnoseRequestProperties, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import DiagnoseResponseResult as RestDiagnoseResponseResult -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import DiagnoseResponseResult as RestDiagnoseResponseResult +from azure.ai.ml._restclient.arm_ml_service.models import ( DiagnoseResponseResultValue as RestDiagnoseResponseResultValue, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import DiagnoseResult as RestDiagnoseResult -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import DiagnoseResult as RestDiagnoseResult +from azure.ai.ml._restclient.arm_ml_service.models import ( DiagnoseWorkspaceParameters as RestDiagnoseWorkspaceParameters, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/feature_store_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/feature_store_settings.py index 4a228128e56e..0872138ae84e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/feature_store_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/feature_store_settings.py @@ -6,7 +6,7 @@ from typing import Optional -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import FeatureStoreSettings as RestFeatureStoreSettings +from azure.ai.ml._restclient.arm_ml_service.models import FeatureStoreSettings as RestFeatureStoreSettings from azure.ai.ml.entities._mixins import RestTranslatableMixin from .compute_runtime import ComputeRuntime diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/network_acls.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/network_acls.py index 190770e1f36c..e8f5b7b755ba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/network_acls.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/network_acls.py @@ -4,8 +4,8 @@ from typing import List, Optional -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import IPRule as RestIPRule -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import NetworkAcls as RestNetworkAcls +from azure.ai.ml._restclient.arm_ml_service.models import IPRule as RestIPRule +from azure.ai.ml._restclient.arm_ml_service.models import NetworkAcls as RestNetworkAcls from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/networking.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/networking.py index c51b4ac75a2b..d717ce400cf3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/networking.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/networking.py @@ -5,21 +5,21 @@ from abc import ABC from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import FqdnOutboundRule as RestFqdnOutboundRule -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import FqdnOutboundRule as RestFqdnOutboundRule +from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedNetworkProvisionStatus as RestManagedNetworkProvisionStatus, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ManagedNetworkSettings as RestManagedNetwork -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ManagedNetworkSettings as RestManagedNetwork +from azure.ai.ml._restclient.arm_ml_service.models import ( PrivateEndpointDestination as RestPrivateEndpointOutboundRuleDestination, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( PrivateEndpointOutboundRule as RestPrivateEndpointOutboundRule, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ServiceTagDestination as RestServiceTagOutboundRuleDestination, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ServiceTagOutboundRule as RestServiceTagOutboundRule +from azure.ai.ml._restclient.arm_ml_service.models import ServiceTagOutboundRule as RestServiceTagOutboundRule from azure.ai.ml.constants._workspace import IsolationMode, OutboundRuleCategory, OutboundRuleType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/serverless_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/serverless_compute.py index dd1c1600b2e5..4d054b116ba8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/serverless_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/serverless_compute.py @@ -5,7 +5,7 @@ from marshmallow.exceptions import ValidationError -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ServerlessComputeSettings as RestServerlessComputeSettings, ) from azure.ai.ml._schema._utils.utils import ArmId diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py index 99b64f12695f..3dffe76b5f6f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py @@ -8,16 +8,17 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, List, Optional, Tuple, Type, Union -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import FeatureStoreSettings as RestFeatureStoreSettings -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ManagedNetworkSettings as RestManagedNetwork -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ManagedServiceIdentity as RestManagedServiceIdentity -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import NetworkAcls as RestNetworkAcls -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import FeatureStoreSettings as RestFeatureStoreSettings +from azure.ai.ml._restclient.arm_ml_service.models import ManagedNetworkSettings as RestManagedNetwork +from azure.ai.ml._restclient.arm_ml_service.models import ManagedServiceIdentity as RestManagedServiceIdentity +from azure.ai.ml._restclient.arm_ml_service.models import NetworkAcls as RestNetworkAcls +from azure.ai.ml._restclient.arm_ml_service.models import ( ServerlessComputeSettings as RestServerlessComputeSettings, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import Workspace as RestWorkspace +from azure.ai.ml._restclient.arm_ml_service.models import Workspace as RestWorkspace from azure.ai.ml._schema.workspace.workspace import WorkspaceSchema from azure.ai.ml._utils.utils import dump_yaml_to_file +from azure.ai.ml._utils._workspace_utils import get_removed_workspace_property, set_removed_workspace_property from azure.ai.ml.constants._common import ( BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, @@ -357,9 +358,13 @@ def _from_rest_object( mlflow_tracking_uri = rest_obj.ml_flow_tracking_uri # TODO: Remove once Online Endpoints updates API version to at least 2023-08-01 + # allowRoleAssignmentOnRG was @removed at api-version 2025-12-01, so it is not declared on the + # shared arm_ml_service Workspace model; read it from the flattened wire envelope instead. allow_roleassignment_on_rg = None if hasattr(rest_obj, "allow_role_assignment_on_rg"): allow_roleassignment_on_rg = rest_obj.allow_role_assignment_on_rg + else: + allow_roleassignment_on_rg = get_removed_workspace_property(rest_obj, "allowRoleAssignmentOnRG") system_datastores_auth_mode = None if hasattr(rest_obj, "system_datastores_auth_mode"): system_datastores_auth_mode = rest_obj.system_datastores_auth_mode @@ -402,6 +407,14 @@ def _from_rest_object( if hasattr(rest_obj, "network_acls"): if rest_obj.network_acls and isinstance(rest_obj.network_acls, RestNetworkAcls): network_acls = NetworkAcls._from_rest_object(rest_obj.network_acls) # pylint: disable=protected-access + else: + # networkAcls was @removed at api-version 2025-12-01, so it is not declared on the shared + # arm_ml_service Workspace model; read it from the flattened wire envelope instead. + rest_network_acls = get_removed_workspace_property(rest_obj, "networkAcls") + if rest_network_acls: + network_acls = NetworkAcls._from_rest_object( # pylint: disable=protected-access + RestNetworkAcls(rest_network_acls) + ) return cls( name=rest_obj.name, @@ -451,7 +464,7 @@ def _to_rest_object(self) -> RestWorkspace: if self.serverless_compute: serverless_compute_settings = self.serverless_compute._to_rest_object() # pylint: disable=protected-access - return RestWorkspace( + rest_workspace = RestWorkspace( name=self.name, identity=( self.identity._to_workspace_rest_object() if self.identity else None # pylint: disable=protected-access @@ -479,10 +492,14 @@ def _to_rest_object(self) -> RestWorkspace: system_datastores_auth_mode=self.system_datastores_auth_mode, feature_store_settings=feature_store_settings, enable_data_isolation=self.enable_data_isolation, - allow_role_assignment_on_rg=self.allow_roleassignment_on_rg, # diff due to swagger restclient casing diff hub_resource_id=self._hub_id, serverless_compute_settings=serverless_compute_settings, ) + # allowRoleAssignmentOnRG was @removed at api-version 2025-12-01 and is not a constructor field + # on the shared arm_ml_service Workspace model; set it on the flattened wire envelope instead. + # diff due to swagger restclient casing diff + set_removed_workspace_property(rest_workspace, "allowRoleAssignmentOnRG", self.allow_roleassignment_on_rg) + return rest_workspace # Helper for sub-class polymorphism. Needs to be overwritten by child classes # If they don't want to redefine things like _to_dict. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace_keys.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace_keys.py index 96142d3df569..59283ec46a0e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace_keys.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace_keys.py @@ -4,7 +4,7 @@ from typing import List, Optional -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ListWorkspaceKeysResult +from azure.ai.ml._restclient.arm_ml_service.models import ListWorkspaceKeysResult class ContainerRegistryCredential: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py index 4772e7cb0193..17e3572b9b36 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_datastore_operations.py @@ -13,11 +13,11 @@ from azure.ai.ml._exception_helper import log_and_raise_error from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview from azure.ai.ml._restclient.v2024_01_01_preview.models import ComputeInstanceDataMount -from azure.ai.ml._restclient.v2024_10_01_preview_tsp import ( +from azure.ai.ml._restclient.arm_ml_service import ( MachineLearningServicesMgmtClient as ServiceClient102024Preview, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import Datastore as DatastoreData -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import Datastore as DatastoreData +from azure.ai.ml._restclient.arm_ml_service.models import ( DatastoreSecrets, NoneDatastoreCredentials, ) @@ -48,7 +48,7 @@ class DatastoreOperations(_ScopeDependentOperations): _azure_machine_learning_workspaces.AzureMachineLearningWorkspaces :param serviceclient_2024_10_01_preview: Service client to allow end users to operate on Azure Machine Learning Workspace resources. - :type serviceclient_2024_10_01_preview: ~azure.ai.ml._restclient.v2024_10_01_preview_tsp. + :type serviceclient_2024_10_01_preview: ~azure.ai.ml._restclient.arm_ml_service. MachineLearningServicesMgmtClient """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_store_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_store_operations.py index c147d107bc77..1862a88c4923 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_store_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_feature_store_operations.py @@ -10,10 +10,10 @@ from marshmallow import ValidationError -from azure.ai.ml._restclient.v2024_10_01_preview_tsp import ( +from azure.ai.ml._restclient.arm_ml_service import ( MachineLearningServicesMgmtClient as ServiceClient102024Preview, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ManagedNetworkProvisionOptions +from azure.ai.ml._restclient.arm_ml_service.models import ManagedNetworkProvisionOptions from azure.ai.ml._scope_dependent_operations import OperationsContainer, OperationScope from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._logger_utils import OpsLogger diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index bc47aa84e028..ab29821719a1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -31,7 +31,7 @@ from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, ListViewType, UserIdentity from azure.ai.ml._restclient.v2023_08_01_preview.models import JobType as RestJobType from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as JobBase_2401 -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import JobType as RestJobType_20241001Preview +from azure.ai.ml._restclient.arm_ml_service.models import JobType as RestJobType_20241001Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, OperationsContainer, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations.py index bebf9d563240..6936f238ddb0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations.py @@ -8,10 +8,10 @@ from marshmallow import ValidationError -from azure.ai.ml._restclient.v2024_10_01_preview_tsp import ( +from azure.ai.ml._restclient.arm_ml_service import ( MachineLearningServicesMgmtClient as ServiceClient102024Preview, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ManagedNetworkProvisionOptions +from azure.ai.ml._restclient.arm_ml_service.models import ManagedNetworkProvisionOptions from azure.ai.ml._scope_dependent_operations import OperationsContainer, OperationScope from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._http_utils import HttpPipeline diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py index 35615d948d2f..2146614ca11d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py @@ -11,10 +11,10 @@ from azure.ai.ml._arm_deployments import ArmDeploymentExecutor from azure.ai.ml._arm_deployments.arm_helper import get_template -from azure.ai.ml._restclient.v2024_10_01_preview_tsp import ( +from azure.ai.ml._restclient.arm_ml_service import ( MachineLearningServicesMgmtClient as ServiceClient102024Preview, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( EncryptionKeyVaultUpdateProperties, EncryptionUpdateProperties, WorkspaceUpdateParameters, @@ -32,6 +32,7 @@ get_resource_and_group_name, get_resource_group_location, get_sub_id_resource_and_group_name, + set_removed_workspace_property, ) from azure.ai.ml._utils.utils import camel_to_snake, from_iso_duration_format_min_sec from azure.ai.ml._version import VERSION @@ -378,9 +379,6 @@ def begin_update( system_datastores_auth_mode=kwargs.get( "system_datastores_auth_mode", workspace.system_datastores_auth_mode ), - allow_role_assignment_on_rg=kwargs.get( - "allow_roleassignment_on_rg", workspace.allow_roleassignment_on_rg - ), # diff due to swagger restclient casing diff image_build_compute=kwargs.get("image_build_compute", workspace.image_build_compute), identity=identity, primary_user_assigned_identity=kwargs.get( @@ -388,7 +386,19 @@ def begin_update( ), managed_network=managed_network, feature_store_settings=feature_store_settings, - network_acls=network_acls, + ) + # allowRoleAssignmentOnRG and networkAcls were @removed at api-version 2025-12-01 and are not + # constructor fields on the shared arm_ml_service WorkspaceUpdateParameters model; set them on + # the flattened wire envelope instead. diff due to swagger restclient casing diff. + set_removed_workspace_property( + update_param, + "allowRoleAssignmentOnRG", + kwargs.get("allow_roleassignment_on_rg", workspace.allow_roleassignment_on_rg), + ) + set_removed_workspace_property( + update_param, + "networkAcls", + network_acls.as_dict() if network_acls else None, ) if serverless_compute_settings: update_param.serverless_compute_settings = serverless_compute_settings diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_outbound_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_outbound_rule_operations.py index 991a677dda18..9c4541ffcb6f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_outbound_rule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_outbound_rule_operations.py @@ -4,10 +4,10 @@ from typing import Any, Dict, Iterable, Optional -from azure.ai.ml._restclient.v2024_10_01_preview_tsp import ( +from azure.ai.ml._restclient.arm_ml_service import ( MachineLearningServicesMgmtClient as ServiceClient102024Preview, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import OutboundRuleBasicResource +from azure.ai.ml._restclient.arm_ml_service.models import OutboundRuleBasicResource from azure.ai.ml._scope_dependent_operations import OperationsContainer, OperationScope from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._logger_utils import OpsLogger diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 59be85932334..b5f9b57e49bb 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -310,7 +310,7 @@ def mock_aml_services_2024_01_01_preview(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2024_10_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2024_10_01_preview_tsp") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture diff --git a/sdk/ml/azure-ai-ml/tests/finetuning_job/conftest.py b/sdk/ml/azure-ai-ml/tests/finetuning_job/conftest.py index 0e56681f4ee2..8145e528a52f 100644 --- a/sdk/ml/azure-ai-ml/tests/finetuning_job/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/finetuning_job/conftest.py @@ -14,7 +14,7 @@ CustomModelFineTuningJob, ) from azure.ai.ml.entities._inputs_outputs import Input, Output -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( FineTuningJob as RestFineTuningJob, ) diff --git a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py index 1aa562834b4c..14baaa679478 100644 --- a/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py +++ b/sdk/ml/azure-ai-ml/tests/finetuning_job/unittests/test_finetuning_job_convesion.py @@ -1,7 +1,7 @@ from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.entities._inputs_outputs import Input, Output from typing import Optional, Dict -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( UriFileJobInput, MLFlowModelJobInput, ) diff --git a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_entity.py b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_entity.py index 486bc0ec1c8f..b8a283750e68 100644 --- a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_entity.py +++ b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_entity.py @@ -5,7 +5,7 @@ from marshmallow.exceptions import ValidationError from azure.ai.ml import load_workspace -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( Workspace as RestWorkspace, ) from azure.ai.ml.constants._workspace import FirewallSku, IsolationMode diff --git a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations.py b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations.py index d5474c502615..be19baf3fa85 100644 --- a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations.py +++ b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations.py @@ -7,10 +7,10 @@ from pytest_mock import MockFixture from azure.ai.ml import load_workspace -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ServerlessComputeSettings as RestServerlessComputeSettings, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import Workspace as RestWorkspace +from azure.ai.ml._restclient.arm_ml_service.models import Workspace as RestWorkspace from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.entities import ( CustomerManagedKey, diff --git a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations_base.py b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations_base.py index ea37f4f08cd4..afa4c66699f3 100644 --- a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations_base.py +++ b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations_base.py @@ -6,11 +6,11 @@ import pytest from pytest_mock import MockFixture -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( EncryptionKeyVaultUpdateProperties, EncryptionUpdateProperties, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ServerlessComputeSettings as RestServerlessComputeSettings, ) from azure.ai.ml._scope_dependent_operations import OperationScope @@ -238,7 +238,9 @@ def outgoing_call(rg, name, params, polling, cls): ) assert params.managed_network.isolation_mode == "Disabled" assert params.system_datastores_auth_mode == "identity" - assert params.allow_role_assignment_on_rg == True # diff due to swagger restclient casing diff + # allowRoleAssignmentOnRG was @removed at api-version 2025-12-01, so it is not a declared + # attribute on the shared arm_ml_service model; assert it is set on the flattened wire envelope. + assert params.as_dict().get("properties", {}).get("allowRoleAssignmentOnRG") == True assert params.managed_network.outbound_rules == {} assert polling is True assert callable(cls) diff --git a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_related_restclients.py b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_related_restclients.py index f438329b1a2c..784a090ae9c6 100644 --- a/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_related_restclients.py +++ b/sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_related_restclients.py @@ -3,35 +3,35 @@ import pytest from azure.ai.ml import MLClient -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import FeatureStoreSettings as RestFeatureStoreSettings -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import FqdnOutboundRule as RestFqdnOutboundRule -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import FeatureStoreSettings as RestFeatureStoreSettings +from azure.ai.ml._restclient.arm_ml_service.models import FqdnOutboundRule as RestFqdnOutboundRule +from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedNetworkProvisionStatus as RestManagedNetworkProvisionStatus, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ManagedNetworkSettings as RestManagedNetwork -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ManagedServiceIdentity as RestManagedServiceIdentity -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ManagedNetworkSettings as RestManagedNetwork +from azure.ai.ml._restclient.arm_ml_service.models import ManagedServiceIdentity as RestManagedServiceIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ( PrivateEndpointDestination as RestPrivateEndpointOutboundRuleDestination, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( PrivateEndpointOutboundRule as RestPrivateEndpointOutboundRule, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ServerlessComputeSettings as RestServerlessComputeSettings, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( ServiceTagDestination as RestServiceTagOutboundRuleDestination, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ServiceTagOutboundRule as RestServiceTagOutboundRule -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import UserAssignedIdentity -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ServiceTagOutboundRule as RestServiceTagOutboundRule +from azure.ai.ml._restclient.arm_ml_service.models import UserAssignedIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ( Workspace as RestWorkspace, # this one only for workspace hubs ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.models import WorkspaceHubConfig as RestWorkspaceHubConfig -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations import ( +from azure.ai.ml._restclient.arm_ml_service.models import WorkspaceHubConfig as RestWorkspaceHubConfig +from azure.ai.ml._restclient.arm_ml_service.operations import ( ManagedNetworkSettingsRuleOperations as RestClientManagedNetworkSettingsRuleOperations, ) -from azure.ai.ml._restclient.v2024_10_01_preview_tsp.operations import ( +from azure.ai.ml._restclient.arm_ml_service.operations import ( WorkspacesOperations as RestClientWorkspacesOperations, ) from azure.ai.ml.constants._workspace import IsolationMode From 69265e9a8dc6f3cfd33afb13e224bd692d22c740 Mon Sep 17 00:00:00 2001 From: Saanika Gupta Date: Fri, 19 Jun 2026 14:32:45 +0530 Subject: [PATCH 6/6] Migrate v2022_01_01_preview consumers to shared arm_ml_service client Move the workspace-connection auth models off the per-version v2022_01_01_preview package onto the shared arm_ml_service client and delete the package. - entities/_credentials.py: re-source the workspace-connection auth models from arm_ml_service with their current (renamed) names: PersonalAccessToken -> WorkspaceConnectionPersonalAccessToken, ServicePrincipal -> WorkspaceConnectionServicePrincipal, SharedAccessSignature -> WorkspaceConnectionSharedAccessSignature, UsernamePassword -> WorkspaceConnectionUsernamePassword, ManagedIdentity -> WorkspaceConnectionManagedIdentity. - Cross-version coupling fix: the compute identity (IdentityConfiguration _to_compute_rest_object / _from_compute_rest_object, used by aml/compute_instance/ kubernetes/synapsespark compute) is serialized through the msrest v2022_10 ComputeResource. Source those two models from v2022_10_01_preview msrest instead of arm_ml_service so msrest serialization keeps working: Identity -> v2022_10_01_preview.ManagedServiceIdentity (same fields), and UserAssignedIdentity -> v2022_10_01_preview.UserAssignedIdentity. Without this the hybrid models raise SerializationError ('object has no attribute _attribute_map'). - Update conftest mock fixture and the connection unit test to import from arm_ml_service. - Delete the now-unused azure/ai/ml/_restclient/v2022_01_01_preview/ package. --- .../v2022_01_01_preview/__init__.py | 18 - .../_azure_machine_learning_workspaces.py | 129 - .../v2022_01_01_preview/_configuration.py | 71 - .../v2022_01_01_preview/_metadata.json | 111 - .../_restclient/v2022_01_01_preview/_patch.py | 31 - .../v2022_01_01_preview/_vendor.py | 27 - .../v2022_01_01_preview/_version.py | 9 - .../v2022_01_01_preview/aio/__init__.py | 15 - .../aio/_azure_machine_learning_workspaces.py | 122 - .../v2022_01_01_preview/aio/_configuration.py | 67 - .../v2022_01_01_preview/aio/_patch.py | 31 - .../aio/operations/__init__.py | 31 - .../aio/operations/_compute_operations.py | 1002 --- .../aio/operations/_operations.py | 110 - ...private_endpoint_connections_operations.py | 298 - .../_private_link_resources_operations.py | 96 - .../aio/operations/_quotas_operations.py | 173 - .../aio/operations/_usages_operations.py | 117 - .../_virtual_machine_sizes_operations.py | 92 - .../_workspace_connections_operations.py | 306 - .../_workspace_features_operations.py | 123 - .../aio/operations/_workspaces_operations.py | 1179 --- .../v2022_01_01_preview/models/__init__.py | 519 -- ...azure_machine_learning_workspaces_enums.py | 394 - .../v2022_01_01_preview/models/_models.py | 6600 --------------- .../v2022_01_01_preview/models/_models_py3.py | 7105 ----------------- .../operations/__init__.py | 31 - .../operations/_compute_operations.py | 1418 ---- .../operations/_operations.py | 144 - ...private_endpoint_connections_operations.py | 463 -- .../_private_link_resources_operations.py | 141 - .../operations/_quotas_operations.py | 254 - .../operations/_usages_operations.py | 159 - .../_virtual_machine_sizes_operations.py | 135 - .../_workspace_connections_operations.py | 478 -- .../_workspace_features_operations.py | 167 - .../operations/_workspaces_operations.py | 1720 ---- .../_restclient/v2022_01_01_preview/py.typed | 1 - .../azure/ai/ml/entities/_credentials.py | 24 +- sdk/ml/azure-ai-ml/tests/conftest.py | 2 +- .../unittests/test_connection_operations.py | 2 +- 41 files changed, 15 insertions(+), 23900 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_metadata.json delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_version.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/py.typed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -from ._version import VERSION - -__version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 6eac3691ee8c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -from . import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import ComputeOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse - -class AzureMachineLearningWorkspaces(object): - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> AzureMachineLearningWorkspaces - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py deleted file mode 100644 index 1cb684ea5d9d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2022-01-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_metadata.json b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_metadata.json deleted file mode 100644 index 4965ca034259..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_metadata.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "chosen_version": "2022-01-01-preview", - "total_api_version_list": ["2022-01-01-preview"], - "client": { - "name": "AzureMachineLearningWorkspaces", - "filename": "_azure_machine_learning_workspaces", - "description": "These APIs allow end users to operate on Azure Machine Learning Workspace resources.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMachineLearningWorkspacesConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMachineLearningWorkspacesConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=\"https://management.azure.com\", # type: str", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "workspaces": "WorkspacesOperations", - "usages": "UsagesOperations", - "virtual_machine_sizes": "VirtualMachineSizesOperations", - "quotas": "QuotasOperations", - "compute": "ComputeOperations", - "private_endpoint_connections": "PrivateEndpointConnectionsOperations", - "private_link_resources": "PrivateLinkResourcesOperations", - "workspace_connections": "WorkspaceConnectionsOperations", - "workspace_features": "WorkspaceFeaturesOperations" - } -} \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] - -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 2bc72468b2e6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, Optional, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -from .. import models -from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import ComputeOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -class AzureMachineLearningWorkspaces: - """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.machinelearningservices.aio.operations.Operations - :ivar workspaces: WorkspacesOperations operations - :vartype workspaces: azure.mgmt.machinelearningservices.aio.operations.WorkspacesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.machinelearningservices.aio.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations - :vartype virtual_machine_sizes: - azure.mgmt.machinelearningservices.aio.operations.VirtualMachineSizesOperations - :ivar quotas: QuotasOperations operations - :vartype quotas: azure.mgmt.machinelearningservices.aio.operations.QuotasOperations - :ivar compute: ComputeOperations operations - :vartype compute: azure.mgmt.machinelearningservices.aio.operations.ComputeOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.machinelearningservices.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.machinelearningservices.aio.operations.PrivateLinkResourcesOperations - :ivar workspace_connections: WorkspaceConnectionsOperations operations - :vartype workspace_connections: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations - :ivar workspace_features: WorkspaceFeaturesOperations operations - :vartype workspace_features: - azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "AzureMachineLearningWorkspaces": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py deleted file mode 100644 index 3f27a007d283..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class AzureMachineLearningWorkspacesConfiguration(Configuration): - """Configuration for AzureMachineLearningWorkspaces. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2022-01-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -def patch_sdk(): - pass \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py deleted file mode 100644 index 45a1d6fd6e25..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index b8cf0a739f62..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1002 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComputeOperations: - """ComputeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PaginatedComputeResourcesList or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeResource": - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ComputeResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - parameters: "_models.ClusterUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ComputeResource"]: - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - @distributed_trace - def list_nodes( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AmlComputeNodesInformation or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> "_models.ComputeSecrets": - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore - - - async def _start_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - - - @distributed_trace_async - async def begin_start( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - - async def _stop_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - - - @distributed_trace_async - async def begin_stop( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - - async def _restart_initial( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore - - - @distributed_trace_async - async def begin_restart( - self, - resource_group_name: str, - workspace_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py deleted file mode 100644 index f387f91b3780..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index d1228f865cba..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,298 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateEndpointConnectionsOperations: - """PrivateEndpointConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: - """List all the private endpoint connections associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Gets the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - properties: "_models.PrivateEndpointConnection", - **kwargs: Any - ) -> "_models.PrivateEndpointConnection": - """Update the state of specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. - :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(properties, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - private_endpoint_connection_name: str, - **kwargs: Any - ) -> None: - """Deletes the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 8a9ffadf2be7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateLinkResourcesOperations: - """PrivateLinkResourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.PrivateLinkResourceListResult": - """Gets the private link resources that need to be created for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResourceListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index ce339e75d8b4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class QuotasOperations: - """QuotasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def update( - self, - location: str, - parameters: "_models.QuotaUpdateParameters", - **kwargs: Any - ) -> "_models.UpdateWorkspaceQuotasResult": - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateWorkspaceQuotasResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore - - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 88fa452faeb1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListUsagesResult"]: - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListUsagesResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 7fbe221db73a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualMachineSizesOperations: - """VirtualMachineSizesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list( - self, - location: str, - **kwargs: Any - ) -> "_models.VirtualMachineSizeListResult": - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index eec0ff706432..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,306 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceConnectionsOperations: - """WorkspaceConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - parameters: "_models.WorkspaceConnectionPropertiesV2BasicResource", - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """create. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param parameters: The object for creating or updating a new workspace connection. - :type parameters: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": - """get. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - connection_name: str, - **kwargs: Any - ) -> None: - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - target: Optional[str] = None, - category: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: - """list. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - target=target, - category=category, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - target=target, - category=category, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 2e4752bd6642..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspaceFeaturesOperations: - """WorkspaceFeaturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListAmlUserFeatureResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index f7ef8bea2374..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1179 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacesOperations: - """WorkspacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.Workspace": - """Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.Workspace", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.Workspace", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for creating or updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - workspace_name: str, - parameters: "_models.WorkspaceUpdateParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.Workspace"]: - """Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Workspace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - skip=skip, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore - - async def _diagnose_initial( - self, - resource_group_name: str, - workspace_name: str, - parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - - - @distributed_trace_async - async def begin_diagnose( - self, - resource_group_name: str, - workspace_name: str, - parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.DiagnoseResponseResult"]: - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameter of diagnosing workspace health. - :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either DiagnoseResponseResult or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListWorkspaceKeysResult": - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListWorkspaceKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore - - - async def _resync_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - - - @distributed_trace_async - async def begin_resync_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resync all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - - @distributed_trace - def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListResult"]: - """Lists all the available machine learning workspaces under the specified subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore - - @distributed_trace_async - async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.NotebookAccessTokenResult": - """return notebook access token and refresh token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NotebookAccessTokenResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore - - - async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - - - @distributed_trace_async - async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: - """Prepare a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - - @distributed_trace_async - async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListStorageAccountKeysResult": - """List storage account keys of a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListStorageAccountKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore - - - @distributed_trace_async - async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ListNotebookKeysResult": - """List keys of a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListNotebookKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore - - - @distributed_trace_async - async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.ExternalFQDNResponse": - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalFQDNResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py deleted file mode 100644 index 2af3a2f5b95a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py +++ /dev/null @@ -1,519 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AKS - from ._models_py3 import AKSProperties - from ._models_py3 import AksComputeSecrets - from ._models_py3 import AksComputeSecretsProperties - from ._models_py3 import AksNetworkingConfiguration - from ._models_py3 import AmlCompute - from ._models_py3 import AmlComputeNodeInformation - from ._models_py3 import AmlComputeNodesInformation - from ._models_py3 import AmlComputeProperties - from ._models_py3 import AmlUserFeature - from ._models_py3 import AssignedUser - from ._models_py3 import AutoPauseProperties - from ._models_py3 import AutoScaleProperties - from ._models_py3 import ClusterUpdateParameters - from ._models_py3 import Components1D3SwueSchemasComputeresourceAllof1 - from ._models_py3 import Compute - from ._models_py3 import ComputeInstance - from ._models_py3 import ComputeInstanceApplication - from ._models_py3 import ComputeInstanceConnectivityEndpoints - from ._models_py3 import ComputeInstanceCreatedBy - from ._models_py3 import ComputeInstanceLastOperation - from ._models_py3 import ComputeInstanceProperties - from ._models_py3 import ComputeInstanceSshSettings - from ._models_py3 import ComputeResource - from ._models_py3 import ComputeSchedules - from ._models_py3 import ComputeSecrets - from ._models_py3 import ComputeStartStopSchedule - from ._models_py3 import ContainerResourceRequirements - from ._models_py3 import CosmosDbSettings - from ._models_py3 import Cron - from ._models_py3 import DataFactory - from ._models_py3 import DataLakeAnalytics - from ._models_py3 import DataLakeAnalyticsProperties - from ._models_py3 import Databricks - from ._models_py3 import DatabricksComputeSecrets - from ._models_py3 import DatabricksComputeSecretsProperties - from ._models_py3 import DatabricksProperties - from ._models_py3 import DiagnoseRequestProperties - from ._models_py3 import DiagnoseResponseResult - from ._models_py3 import DiagnoseResponseResultValue - from ._models_py3 import DiagnoseResult - from ._models_py3 import DiagnoseWorkspaceParameters - from ._models_py3 import EncryptionProperty - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import EstimatedVMPrice - from ._models_py3 import EstimatedVMPrices - from ._models_py3 import ExternalFQDNResponse - from ._models_py3 import FQDNEndpoint - from ._models_py3 import FQDNEndpointDetail - from ._models_py3 import FQDNEndpoints - from ._models_py3 import FQDNEndpointsProperties - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import Identity - from ._models_py3 import IdentityForCmk - from ._models_py3 import InstanceTypeSchema - from ._models_py3 import InstanceTypeSchemaResources - from ._models_py3 import KeyVaultProperties - from ._models_py3 import Kubernetes - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import ListAmlUserFeatureResult - from ._models_py3 import ListNotebookKeysResult - from ._models_py3 import ListStorageAccountKeysResult - from ._models_py3 import ListUsagesResult - from ._models_py3 import ListWorkspaceKeysResult - from ._models_py3 import ListWorkspaceQuotas - from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import NodeStateCounts - from ._models_py3 import NoneAuthTypeWorkspaceConnectionProperties - from ._models_py3 import NotebookAccessTokenResult - from ._models_py3 import NotebookPreparationError - from ._models_py3 import NotebookResourceInfo - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties - from ._models_py3 import PaginatedComputeResourcesList - from ._models_py3 import Password - from ._models_py3 import PersonalAccessToken - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import Recurrence - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import Resource - from ._models_py3 import ResourceAutoGenerated - from ._models_py3 import ResourceId - from ._models_py3 import ResourceName - from ._models_py3 import ResourceQuota - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ScaleSettings - from ._models_py3 import ScaleSettingsInformation - from ._models_py3 import ScriptReference - from ._models_py3 import ScriptsToExecute - from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipal - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalCredentials - from ._models_py3 import SetupScripts - from ._models_py3 import SharedAccessSignature - from ._models_py3 import SharedPrivateLinkResource - from ._models_py3 import Sku - from ._models_py3 import SslConfiguration - from ._models_py3 import SynapseSpark - from ._models_py3 import SynapseSparkProperties - from ._models_py3 import SystemData - from ._models_py3 import SystemService - from ._models_py3 import UpdateWorkspaceQuotas - from ._models_py3 import UpdateWorkspaceQuotasResult - from ._models_py3 import Usage - from ._models_py3 import UsageName - from ._models_py3 import UserAccountCredentials - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import UsernamePassword - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties - from ._models_py3 import VirtualMachine - from ._models_py3 import VirtualMachineImage - from ._models_py3 import VirtualMachineProperties - from ._models_py3 import VirtualMachineSecrets - from ._models_py3 import VirtualMachineSize - from ._models_py3 import VirtualMachineSizeListResult - from ._models_py3 import VirtualMachineSshCredentials - from ._models_py3 import Workspace - from ._models_py3 import WorkspaceConnectionPropertiesV2 - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - from ._models import AKS # type: ignore - from ._models import AKSProperties # type: ignore - from ._models import AksComputeSecrets # type: ignore - from ._models import AksComputeSecretsProperties # type: ignore - from ._models import AksNetworkingConfiguration # type: ignore - from ._models import AmlCompute # type: ignore - from ._models import AmlComputeNodeInformation # type: ignore - from ._models import AmlComputeNodesInformation # type: ignore - from ._models import AmlComputeProperties # type: ignore - from ._models import AmlUserFeature # type: ignore - from ._models import AssignedUser # type: ignore - from ._models import AutoPauseProperties # type: ignore - from ._models import AutoScaleProperties # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import Components1D3SwueSchemasComputeresourceAllof1 # type: ignore - from ._models import Compute # type: ignore - from ._models import ComputeInstance # type: ignore - from ._models import ComputeInstanceApplication # type: ignore - from ._models import ComputeInstanceConnectivityEndpoints # type: ignore - from ._models import ComputeInstanceCreatedBy # type: ignore - from ._models import ComputeInstanceLastOperation # type: ignore - from ._models import ComputeInstanceProperties # type: ignore - from ._models import ComputeInstanceSshSettings # type: ignore - from ._models import ComputeResource # type: ignore - from ._models import ComputeSchedules # type: ignore - from ._models import ComputeSecrets # type: ignore - from ._models import ComputeStartStopSchedule # type: ignore - from ._models import ContainerResourceRequirements # type: ignore - from ._models import CosmosDbSettings # type: ignore - from ._models import Cron # type: ignore - from ._models import DataFactory # type: ignore - from ._models import DataLakeAnalytics # type: ignore - from ._models import DataLakeAnalyticsProperties # type: ignore - from ._models import Databricks # type: ignore - from ._models import DatabricksComputeSecrets # type: ignore - from ._models import DatabricksComputeSecretsProperties # type: ignore - from ._models import DatabricksProperties # type: ignore - from ._models import DiagnoseRequestProperties # type: ignore - from ._models import DiagnoseResponseResult # type: ignore - from ._models import DiagnoseResponseResultValue # type: ignore - from ._models import DiagnoseResult # type: ignore - from ._models import DiagnoseWorkspaceParameters # type: ignore - from ._models import EncryptionProperty # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import EstimatedVMPrice # type: ignore - from ._models import EstimatedVMPrices # type: ignore - from ._models import ExternalFQDNResponse # type: ignore - from ._models import FQDNEndpoint # type: ignore - from ._models import FQDNEndpointDetail # type: ignore - from ._models import FQDNEndpoints # type: ignore - from ._models import FQDNEndpointsProperties # type: ignore - from ._models import HDInsight # type: ignore - from ._models import HDInsightProperties # type: ignore - from ._models import Identity # type: ignore - from ._models import IdentityForCmk # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import KeyVaultProperties # type: ignore - from ._models import Kubernetes # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import ListAmlUserFeatureResult # type: ignore - from ._models import ListNotebookKeysResult # type: ignore - from ._models import ListStorageAccountKeysResult # type: ignore - from ._models import ListUsagesResult # type: ignore - from ._models import ListWorkspaceKeysResult # type: ignore - from ._models import ListWorkspaceQuotas # type: ignore - from ._models import ManagedIdentity # type: ignore - from ._models import ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NodeStateCounts # type: ignore - from ._models import NoneAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import NotebookAccessTokenResult # type: ignore - from ._models import NotebookPreparationError # type: ignore - from ._models import NotebookResourceInfo # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import Password # type: ignore - from ._models import PersonalAccessToken # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import Recurrence # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceAutoGenerated # type: ignore - from ._models import ResourceId # type: ignore - from ._models import ResourceName # type: ignore - from ._models import ResourceQuota # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ScaleSettings # type: ignore - from ._models import ScaleSettingsInformation # type: ignore - from ._models import ScriptReference # type: ignore - from ._models import ScriptsToExecute # type: ignore - from ._models import ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipal # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalCredentials # type: ignore - from ._models import SetupScripts # type: ignore - from ._models import SharedAccessSignature # type: ignore - from ._models import SharedPrivateLinkResource # type: ignore - from ._models import Sku # type: ignore - from ._models import SslConfiguration # type: ignore - from ._models import SynapseSpark # type: ignore - from ._models import SynapseSparkProperties # type: ignore - from ._models import SystemData # type: ignore - from ._models import SystemService # type: ignore - from ._models import UpdateWorkspaceQuotas # type: ignore - from ._models import UpdateWorkspaceQuotasResult # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageName # type: ignore - from ._models import UserAccountCredentials # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UsernamePassword # type: ignore - from ._models import UsernamePasswordAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import VirtualMachine # type: ignore - from ._models import VirtualMachineImage # type: ignore - from ._models import VirtualMachineProperties # type: ignore - from ._models import VirtualMachineSecrets # type: ignore - from ._models import VirtualMachineSize # type: ignore - from ._models import VirtualMachineSizeListResult # type: ignore - from ._models import VirtualMachineSshCredentials # type: ignore - from ._models import Workspace # type: ignore - from ._models import WorkspaceConnectionPropertiesV2 # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResource # type: ignore - from ._models import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - AllocationState, - AllowRecoverSoftDeletedWorkspace, - ApplicationSharingPolicy, - BillingCurrency, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeType, - ConnectionAuthType, - ConnectionCategory, - CreatedByType, - DaysOfWeek, - DiagnoseResultLevel, - EncryptionStatus, - LoadBalancerType, - NodeState, - OperationName, - OperationStatus, - OsType, - PrivateEndpointConnectionProvisioningState, - PrivateEndpointServiceConnectionStatus, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccess, - QuotaUnit, - RecurrenceFrequency, - RemoteLoginPortPublicAccess, - ResourceIdentityType, - ScheduleStatus, - ScheduleType, - SoftDeleteEnabled, - SshPublicAccess, - SslConfigurationStatus, - Status, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - VMPriceOSType, - VMTier, - ValueFormat, - VmPriority, -) - -__all__ = [ - 'AKS', - 'AKSProperties', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlUserFeature', - 'AssignedUser', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'ClusterUpdateParameters', - 'Components1D3SwueSchemasComputeresourceAllof1', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSshSettings', - 'ComputeResource', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'CosmosDbSettings', - 'Cron', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsProperties', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'EncryptionProperty', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'HDInsight', - 'HDInsightProperties', - 'Identity', - 'IdentityForCmk', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesProperties', - 'KubernetesSchema', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'NodeStateCounts', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'Password', - 'PersonalAccessToken', - 'PersonalComputeInstanceSettings', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'Recurrence', - 'RecurrenceSchedule', - 'RegistryListCredentialsResult', - 'Resource', - 'ResourceAutoGenerated', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'SASAuthTypeWorkspaceConnectionProperties', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'ScriptReference', - 'ScriptsToExecute', - 'ServiceManagedResourcesSettings', - 'ServicePrincipal', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalCredentials', - 'SetupScripts', - 'SharedAccessSignature', - 'SharedPrivateLinkResource', - 'Sku', - 'SslConfiguration', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemData', - 'SystemService', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UsernamePassword', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'Workspace', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'AllowRecoverSoftDeletedWorkspace', - 'ApplicationSharingPolicy', - 'BillingCurrency', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'CreatedByType', - 'DaysOfWeek', - 'DiagnoseResultLevel', - 'EncryptionStatus', - 'LoadBalancerType', - 'NodeState', - 'OperationName', - 'OperationStatus', - 'OsType', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'QuotaUnit', - 'RecurrenceFrequency', - 'RemoteLoginPortPublicAccess', - 'ResourceIdentityType', - 'ScheduleStatus', - 'ScheduleType', - 'SoftDeleteEnabled', - 'SshPublicAccess', - 'SslConfigurationStatus', - 'Status', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'VMPriceOSType', - 'VMTier', - 'ValueFormat', - 'VmPriority', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 705bf39fb5b7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,394 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Allocation state of the compute. Possible values are: steady - Indicates that the compute is - not resizing. There are no changes to the number of compute nodes in the compute in progress. A - compute enters this state when it is created and when no operations are being performed on the - compute to change the number of compute nodes. resizing - Indicates that the compute is - resizing; that is, compute nodes are being added to or removed from the compute. - """ - - STEADY = "Steady" - RESIZING = "Resizing" - -class AllowRecoverSoftDeletedWorkspace(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Allow a soft deleted workspace to be recovered - """ - - TRUE = "True" - FALSE = "False" - -class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Policy for sharing applications on this compute instance among users of parent workspace. If - Personal, only the creator can access applications on this compute instance. When Shared, any - workspace user can access applications on this instance depending on his/her assigned role. - """ - - PERSONAL = "Personal" - SHARED = "Shared" - -class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ - - FAST_PROD = "FastProd" - DENSE_PROD = "DenseProd" - DEV_TEST = "DevTest" - -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ - - PERSONAL = "personal" - -class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ - - CREATING = "Creating" - CREATE_FAILED = "CreateFailed" - DELETING = "Deleting" - RUNNING = "Running" - RESTARTING = "Restarting" - JOB_RUNNING = "JobRunning" - SETTING_UP = "SettingUp" - SETUP_FAILED = "SetupFailed" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - USER_SETTING_UP = "UserSettingUp" - USER_SETUP_FAILED = "UserSetupFailed" - UNKNOWN = "Unknown" - UNUSABLE = "Unusable" - -class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ - - AKS = "AKS" - KUBERNETES = "Kubernetes" - AML_COMPUTE = "AmlCompute" - COMPUTE_INSTANCE = "ComputeInstance" - DATA_FACTORY = "DataFactory" - VIRTUAL_MACHINE = "VirtualMachine" - HD_INSIGHT = "HDInsight" - DATABRICKS = "Databricks" - DATA_LAKE_ANALYTICS = "DataLakeAnalytics" - SYNAPSE_SPARK = "SynapseSpark" - -class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - SERVICE_PRINCIPAL = "ServicePrincipal" - -class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - FEATURE_STORE = "FeatureStore" - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class DaysOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - SUNDAY = "Sunday" - MONDAY = "Monday" - TUESDAY = "Tuesday" - WEDNESDAY = "Wednesday" - THURSDAY = "Thursday" - FRIDAY = "Friday" - SATURDAY = "Saturday" - -class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the compute node. Values are idle, running, preparing, unusable, leaving and - preempted. - """ - - IDLE = "idle" - RUNNING = "running" - PREPARING = "preparing" - UNUSABLE = "unusable" - LEAVING = "leaving" - PREEMPTED = "preempted" - -class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ - - CREATE = "Create" - START = "Start" - STOP = "Stop" - RESTART = "Restart" - REIMAGE = "Reimage" - DELETE = "Delete" - -class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CREATE_FAILED = "CreateFailed" - START_FAILED = "StartFailed" - STOP_FAILED = "StopFailed" - RESTART_FAILED = "RestartFailed" - REIMAGE_FAILED = "ReimageFailed" - DELETE_FAILED = "DeleteFailed" - -class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ - - PENDING = "Pending" - APPROVED = "Approved" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - TIMEOUT = "Timeout" - -class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of workspace resource. The provisioningState is to indicate states - for resource provisioning. - """ - - UNKNOWN = "Unknown" - UPDATING = "Updating" - CREATING = "Creating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The recurrence frequency. - """ - - NOT_SPECIFIED = "NotSpecified" - SECOND = "Second" - MINUTE = "Minute" - HOUR = "Hour" - DAY = "Day" - WEEK = "Week" - MONTH = "Month" - YEAR = "Year" - -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is - open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed - on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be - default only during cluster creation time, after creation it will be either enabled or - disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - NOT_SPECIFIED = "NotSpecified" - -class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The identity type. - """ - - SYSTEM_ASSIGNED = "SystemAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - USER_ASSIGNED = "UserAssigned" - NONE = "None" - -class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The schedule status. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The schedule type. - """ - - COMPUTE_START_STOP = "ComputeStartStop" - -class SoftDeleteEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """create a workspace with soft delete capability - """ - - TRUE = "True" - FALSE = "False" - -class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh - port is closed on this instance. Enabled - Indicates that the public ssh port is open and - accessible according to the VNet/subnet policy if applicable. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class SslConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - AUTO = "Auto" - -class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ - - UNDEFINED = "Undefined" - SUCCESS = "Success" - FAILURE = "Failure" - INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" - INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" - OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" - OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" - -class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The schedule trigger type. - """ - - RECURRENCE = "Recurrence" - CRON = "Cron" - -class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DELETE = "Delete" - DETACH = "Detach" - -class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ - - ONE_HOUR = "OneHour" - -class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ - - COUNT = "Count" - -class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ - - JSON = "JSON" - -class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ - - DEDICATED = "Dedicated" - LOW_PRIORITY = "LowPriority" - -class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ - - STANDARD = "Standard" - LOW_PRIORITY = "LowPriority" - SPOT = "Spot" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py deleted file mode 100644 index 0f108d8eacd8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py +++ /dev/null @@ -1,6600 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class AKS(Compute): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AKSProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSProperties - """ - super(AKS, self).__init__(**kwargs) - self.compute_type = 'AKS' # type: str - self.properties = kwargs.get('properties', None) - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) - - -class AKSProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) - self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) - - -class AmlCompute(Compute): - """Properties(top level) of AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlCompute, self).__init__(**kwargs) - self.compute_type = 'AmlCompute' # type: str - self.properties = kwargs.get('properties', None) - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Components1D3SwueSchemasComputeresourceAllof1(msrest.serialization.Model): - """Components1D3SwueSchemasComputeresourceAllof1. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(Components1D3SwueSchemasComputeresourceAllof1, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ComputeInstance(Compute): - """Properties(top level) of ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstance, self).__init__(**kwargs) - self.compute_type = 'ComputeInstance' # type: str - self.properties = kwargs.get('properties', None) - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", - "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "JobRunning", "SettingUp", "SetupFailed", - "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the compute instance. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - """ - - _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the compute instance. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.ssh_settings = kwargs.get('ssh_settings', None) - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) - self.last_operation = None - self.schedules = kwargs.get('schedules', None) - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ComputeResource(Resource, Components1D3SwueSchemasComputeresourceAllof1): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.system_data = None - self.id = None - self.name = None - self.type = None - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.system_data = None - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Schedule id. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: The schedule status. Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar trigger_type: The schedule trigger type. Possible values include: "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar action: The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar recurrence: The workflow trigger recurrence for ComputeStartStop schedule type. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: The workflow trigger cron for ComputeStartStop schedule type. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: The schedule status. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword trigger_type: The schedule trigger type. Possible values include: "Recurrence", - "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :keyword action: The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword recurrence: The workflow trigger recurrence for ComputeStartStop schedule type. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: The workflow trigger cron for ComputeStartStop schedule type. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = kwargs.get('status', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.action = kwargs.get('action', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - - -class ContainerResourceRequirements(msrest.serialization.Model): - """The resource requirements for the container (cpu and memory). - - :ivar cpu: The minimum amount of CPU cores to be used by the container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: float - :ivar cpu_limit: The maximum amount of CPU cores allowed to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu_limit: float - :ivar memory_in_gb: The minimum amount of memory (in GB) to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory_in_gb: float - :ivar memory_in_gb_limit: The maximum amount of memory (in GB) allowed to be used by the - container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory_in_gb_limit: float - :ivar gpu: The number of GPU cores in the container. - :vartype gpu: int - :ivar fpga: The number of FPGA PCIE devices exposed to the container. Must be multiple of 2. - :vartype fpga: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'float'}, - 'cpu_limit': {'key': 'cpuLimit', 'type': 'float'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, - 'memory_in_gb_limit': {'key': 'memoryInGBLimit', 'type': 'float'}, - 'gpu': {'key': 'gpu', 'type': 'int'}, - 'fpga': {'key': 'fpga', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cpu: The minimum amount of CPU cores to be used by the container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: float - :keyword cpu_limit: The maximum amount of CPU cores allowed to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu_limit: float - :keyword memory_in_gb: The minimum amount of memory (in GB) to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory_in_gb: float - :keyword memory_in_gb_limit: The maximum amount of memory (in GB) allowed to be used by the - container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory_in_gb_limit: float - :keyword gpu: The number of GPU cores in the container. - :paramtype gpu: int - :keyword fpga: The number of FPGA PCIE devices exposed to the container. Must be multiple of 2. - :paramtype fpga: int - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.cpu_limit = kwargs.get('cpu_limit', None) - self.memory_in_gb = kwargs.get('memory_in_gb', None) - self.memory_in_gb_limit = kwargs.get('memory_in_gb_limit', None) - self.gpu = kwargs.get('gpu', None) - self.fpga = kwargs.get('fpga', None) - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: The throughput of the collections in cosmosdb database. - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword collections_throughput: The throughput of the collections in cosmosdb database. - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time. - :vartype start_time: str - :ivar time_zone: The time zone. - :vartype time_zone: str - :ivar expression: The cron expression. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword start_time: The start time. - :paramtype start_time: str - :keyword time_zone: The time zone. - :paramtype time_zone: str - :keyword expression: The cron expression. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', None) - self.expression = kwargs.get('expression', None) - - -class Databricks(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(Databricks, self).__init__(**kwargs) - self.compute_type = 'Databricks' # type: str - self.properties = kwargs.get('properties', None) - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataLakeAnalytics(Compute): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.compute_type = 'DataLakeAnalytics' # type: str - self.properties = kwargs.get('properties', None) - - -class DataLakeAnalyticsProperties(msrest.serialization.Model): - """DataLakeAnalyticsProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - """ - - _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: Value of Parameters. - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Value of Parameters. - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar identity: The identity that will be used to access the key vault for encryption at rest. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. Customer Key vault properties. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar cosmos_db_resource_id: The Bring-Your-Own cosmosdb account that customer brings to store - data. - :vartype cosmos_db_resource_id: str - :ivar storage_account_resource_id: The Bring-Your-Own storage account that customer brings to - store data. - :vartype storage_account_resource_id: str - :ivar search_account_resource_id: The Bring-Your-Own search account that customer brings to - store index. - :vartype search_account_resource_id: str - """ - - _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword identity: The identity that will be used to access the key vault for encryption at - rest. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. Customer Key vault properties. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword cosmos_db_resource_id: The Bring-Your-Own cosmosdb account that customer brings to - store data. - :paramtype cosmos_db_resource_id: str - :keyword storage_account_resource_id: The Bring-Your-Own storage account that customer brings - to store data. - :paramtype storage_account_resource_id: str - :keyword search_account_resource_id: The Bring-Your-Own search account that customer brings to - store index. - :paramtype search_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - self.cosmos_db_resource_id = kwargs.get('cosmos_db_resource_id', None) - self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) - self.search_account_resource_id = kwargs.get('search_account_resource_id', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class FQDNEndpointsProperties(msrest.serialization.Model): - """FQDNEndpointsProperties. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class HDInsight(Compute): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsight, self).__init__(**kwargs) - self.compute_type = 'HDInsight' # type: str - self.properties = kwargs.get('properties', None) - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Possible values include: "SystemAssigned", - "SystemAssigned,UserAssigned", "UserAssigned", "None". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType - :ivar user_assigned_identities: The user assigned identities associated with the resource. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword type: The identity type. Possible values include: "SystemAssigned", - "SystemAssigned,UserAssigned", "UserAssigned", "None". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType - :keyword user_assigned_identities: The user assigned identities associated with the resource. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class IdentityForCmk(msrest.serialization.Model): - """Identity that will be used to access key vault for encryption at rest. - - :ivar user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) - - -class KeyVaultProperties(msrest.serialization.Model): - """KeyVaultProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption - key is present. - :vartype key_vault_arm_id: str - :ivar key_identifier: Required. Key vault uri to access the encryption key. - :vartype key_identifier: str - :ivar identity_client_id: For future use - The client id of the identity which will be used to - access key vault. - :vartype identity_client_id: str - """ - - _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned - encryption key is present. - :paramtype key_vault_arm_id: str - :keyword key_identifier: Required. Key vault uri to access the encryption key. - :paramtype key_identifier: str - :keyword identity_client_id: For future use - The client id of the identity which will be used - to access key vault. - :paramtype identity_client_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) - self.provisioning_state = None - self.description = kwargs.get('description', None) - self.created_on = None - self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: - :vartype primary_access_key: str - :ivar secondary_access_key: - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - :ivar user_storage_resource_id: - :vartype user_storage_resource_id: str - :ivar app_insights_instrumentation_key: - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - self.user_storage_resource_id = None - self.app_insights_instrumentation_key = None - self.container_registry_credentials = None - self.notebook_access_keys = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ManagedIdentity(msrest.serialization.Model): - """ManagedIdentity. - - :ivar resource_id: - :vartype resource_id: str - :ivar client_id: - :vartype client_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: - :paramtype resource_id: str - :keyword client_id: - :paramtype client_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - } - - _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) - self.metadata = kwargs.get('metadata', None) - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.ManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar host_name: - :vartype host_name: str - :ivar public_dns: - :vartype public_dns: str - :ivar access_token: - :vartype access_token: str - :ivar token_type: - :vartype token_type: str - :ivar expires_in: - :vartype expires_in: int - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - """ - - _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - } - - _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.notebook_resource_id = None - self.host_name = None - self.public_dns = None - self.access_token = None - self.token_type = None - self.expires_in = None - self.refresh_token = None - self.scope = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) - - -class Operation(msrest.serialization.Model): - """Azure Machine Learning workspace REST API operation. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: Display name of operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - - -class OperationDisplay(msrest.serialization.Model): - """Display name of operation. - - :ivar provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :vartype provider: str - :ivar resource: The resource on which the operation is performed. - :vartype resource: str - :ivar operation: The operation that users can perform. - :vartype operation: str - :ivar description: The description for the operation. - :vartype description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :paramtype provider: str - :keyword resource: The resource on which the operation is performed. - :paramtype resource: str - :keyword operation: The operation that users can perform. - :paramtype operation: str - :keyword description: The description for the operation. - :paramtype description: str - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML workspace operations supported by the AML workspace resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: List of AML workspace operations supported by the AML workspace resource - provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Operation] - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.PersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'PersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.PersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) - - -class PersonalAccessToken(msrest.serialization.Model): - """PersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(PersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The ARM identifier for Subnet resource that private endpoint links to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Possible values include: "Succeeded", "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword private_endpoint: The resource of private end point. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :keyword private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.system_data = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = None - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.system_data = None - self.group_id = None - self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Array of private link resources. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :ivar description: The reason for approval/rejection of the connection. - :vartype description: str - :ivar actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :vartype actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :keyword description: The reason for approval/rejection of the connection. - :paramtype description: str - :keyword actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :paramtype actions_required: str - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: The recurrence frequency. Possible values include: "NotSpecified", "Second", - "Minute", "Hour", "Day", "Week", "Month", "Year". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: The interval. - :vartype interval: int - :ivar start_time: The start time. - :vartype start_time: str - :ivar time_zone: The time zone. - :vartype time_zone: str - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword frequency: The recurrence frequency. Possible values include: "NotSpecified", - "Second", "Minute", "Hour", "Day", "Week", "Month", "Year". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: The interval. - :paramtype interval: int - :keyword start_time: The start time. - :paramtype start_time: str - :keyword time_zone: The time zone. - :paramtype time_zone: str - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', None) - self.schedule = kwargs.get('schedule', None) - - -class RecurrenceSchedule(msrest.serialization.Model): - """The recurrence schedule. - - :ivar minutes: The minutes. - :vartype minutes: list[int] - :ivar hours: The hours. - :vartype hours: list[int] - :ivar week_days: The days of the week. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.DaysOfWeek] - """ - - _attribute_map = { - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'hours': {'key': 'hours', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword minutes: The minutes. - :paramtype minutes: list[int] - :keyword hours: The hours. - :paramtype hours: list[int] - :keyword week_days: The days of the week. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.DaysOfWeek] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.minutes = kwargs.get('minutes', None) - self.hours = kwargs.get('hours', None) - self.week_days = kwargs.get('week_days', None) - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: - :vartype location: str - :ivar username: - :vartype username: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.username = None - self.passwords = kwargs.get('passwords', None) - - -class ResourceAutoGenerated(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceAutoGenerated, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.SharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'SharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.SharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: The settings for the service managed cosmosdb account. - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cosmos_db: The settings for the service managed cosmosdb account. - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) - - -class ServicePrincipal(msrest.serialization.Model): - """ServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(ServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.ServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) - - -class ServicePrincipalCredentials(msrest.serialization.Model): - """Service principal credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar client_id: Required. Client Id. - :vartype client_id: str - :ivar client_secret: Required. Client secret. - :vartype client_secret: str - """ - - _validation = { - 'client_id': {'required': True}, - 'client_secret': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword client_id: Required. Client Id. - :paramtype client_id: str - :keyword client_secret: Required. Client secret. - :paramtype client_secret: str - """ - super(ServicePrincipalCredentials, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.client_secret = kwargs['client_secret'] - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) - - -class SharedAccessSignature(msrest.serialization.Model): - """SharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(SharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar private_link_resource_id: The resource id that private link links to. - :vartype private_link_resource_id: str - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword private_link_resource_id: The resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) - - -class Sku(msrest.serialization.Model): - """Sku of the resource. - - :ivar name: Name of the sku. - :vartype name: str - :ivar tier: Tier of the sku like Basic or Enterprise. - :vartype tier: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the sku. - :paramtype name: str - :keyword tier: Tier of the sku like Basic or Enterprise. - :paramtype tier: str - """ - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = kwargs.get('limit', None) - self.unit = None - self.status = kwargs.get('status', None) - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) - - -class UserAssignedIdentity(msrest.serialization.Model): - """User Assigned Identity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the user assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the user assigned identity. - :vartype tenant_id: str - :ivar client_id: The clientId(aka appId) of the user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.client_id = None - - -class UsernamePassword(msrest.serialization.Model): - """UsernamePassword. - - :ivar username: - :vartype username: str - :ivar password: - :vartype password: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: - :paramtype username: str - :keyword password: - :paramtype password: str - """ - super(UsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.UsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'UsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.UsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) - - -class VirtualMachine(Compute): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'VirtualMachineProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties - """ - super(VirtualMachine, self).__init__(**kwargs) - self.compute_type = 'VirtualMachine' # type: str - self.properties = kwargs.get('properties', None) - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualMachineProperties(msrest.serialization.Model): - """VirtualMachineProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) - - -class VirtualMachineSecrets(ComputeSecrets): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.compute_type = 'VirtualMachine' # type: str - self.administrator_account = kwargs.get('administrator_account', None) - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar application_insights: ARM id of the application insights associated with this workspace. - This cannot be changed once the workspace has been created. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype container_registry: str - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar encryption: The encryption settings of Azure ML workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar soft_delete_enabled: create a workspace with soft delete capability. Possible values - include: "True", "False". - :vartype soft_delete_enabled: str or - ~azure.mgmt.machinelearningservices.models.SoftDeleteEnabled - :ivar allow_recover_soft_deleted_workspace: Allow a soft deleted workspace to be recovered. - Possible values include: "True", "False". - :vartype allow_recover_soft_deleted_workspace: str or - ~azure.mgmt.machinelearningservices.models.AllowRecoverSoftDeletedWorkspace - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'soft_delete_enabled': {'key': 'properties.softDeleteEnabled', 'type': 'str'}, - 'allow_recover_soft_deleted_workspace': {'key': 'properties.allowRecoverSoftDeletedWorkspace', 'type': 'str'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword application_insights: ARM id of the application insights associated with this - workspace. This cannot be changed once the workspace has been created. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - This cannot be changed once the workspace has been created. - :paramtype container_registry: str - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword encryption: The encryption settings of Azure ML workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword soft_delete_enabled: create a workspace with soft delete capability. Possible values - include: "True", "False". - :paramtype soft_delete_enabled: str or - ~azure.mgmt.machinelearningservices.models.SoftDeleteEnabled - :keyword allow_recover_soft_deleted_workspace: Allow a soft deleted workspace to be recovered. - Possible values include: "True", "False". - :paramtype allow_recover_soft_deleted_workspace: str or - ~azure.mgmt.machinelearningservices.models.AllowRecoverSoftDeletedWorkspace - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - """ - super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.system_data = None - self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) - self.soft_delete_enabled = kwargs.get('soft_delete_enabled', None) - self.allow_recover_soft_deleted_workspace = kwargs.get('allow_recover_soft_deleted_workspace', None) - self.service_provisioned_resource_group = None - self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) - self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) - self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.tenant_id = None - self.storage_hns_enabled = None - self.ml_flow_tracking_uri = None - - -class WorkspaceConnectionPropertiesV2BasicResource(ResourceAutoGenerated): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - :ivar next_link: - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :ivar next_link: The URI that can be used to request the next list of machine learning - workspaces. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :keyword next_link: The URI that can be used to request the next list of machine learning - workspaces. - :paramtype next_link: str - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py deleted file mode 100644 index ccb9c8d912c3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py +++ /dev/null @@ -1,7105 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._azure_machine_learning_workspaces_enums import * - - -class Compute(msrest.serialization.Model): - """Machine Learning compute object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, Kubernetes, SynapseSpark, VirtualMachine. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class AKS(Compute): - """A Machine Learning compute based on AKS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: AKS properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AKSProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AKSProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["AKSProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSProperties - """ - super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'AKS' # type: str - self.properties = properties - - -class AksComputeSecretsProperties(msrest.serialization.Model): - """Properties of AksComputeSecrets. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - """ - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - - -class ComputeSecrets(msrest.serialization.Model): - """Secrets related to a Machine Learning compute. Might differ for every type of compute. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - - -class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype user_kube_config: str - :ivar admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :vartype admin_kube_config: str - :ivar image_pull_secret_name: Image registry pull secret. - :vartype image_pull_secret_name: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - user_kube_config: Optional[str] = None, - admin_kube_config: Optional[str] = None, - image_pull_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype user_kube_config: str - :keyword admin_kube_config: Content of kubeconfig file that can be used to connect to the - Kubernetes cluster. - :paramtype admin_kube_config: str - :keyword image_pull_secret_name: Image registry pull secret. - :paramtype image_pull_secret_name: str - """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) - self.user_kube_config = user_kube_config - self.admin_kube_config = admin_kube_config - self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str - - -class AksNetworkingConfiguration(msrest.serialization.Model): - """Advance configuration for AKS networking. - - :ivar subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet_id: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :vartype docker_bridge_cidr: str - """ - - _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_id: Optional[str] = None, - service_cidr: Optional[str] = None, - dns_service_ip: Optional[str] = None, - docker_bridge_cidr: Optional[str] = None, - **kwargs - ): - """ - :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet_id: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :paramtype docker_bridge_cidr: str - """ - super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = subnet_id - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.docker_bridge_cidr = docker_bridge_cidr - - -class AKSProperties(msrest.serialization.Model): - """AKS properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_fqdn: Cluster full qualified domain name. - :vartype cluster_fqdn: str - :ivar system_services: System services. - :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] - :ivar agent_count: Number of agents. - :vartype agent_count: int - :ivar agent_vm_size: Agent virtual machine size. - :vartype agent_vm_size: str - :ivar cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :vartype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :ivar ssl_configuration: SSL configuration. - :vartype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :ivar aks_networking_configuration: AKS networking configuration for vnet. - :vartype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :ivar load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :vartype load_balancer_type: str or ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :ivar load_balancer_subnet: Load Balancer Subnet. - :vartype load_balancer_subnet: str - """ - - _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, - } - - _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_fqdn: Optional[str] = None, - agent_count: Optional[int] = None, - agent_vm_size: Optional[str] = None, - cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", - ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", - load_balancer_subnet: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_fqdn: Cluster full qualified domain name. - :paramtype cluster_fqdn: str - :keyword agent_count: Number of agents. - :paramtype agent_count: int - :keyword agent_vm_size: Agent virtual machine size. - :paramtype agent_vm_size: str - :keyword cluster_purpose: Intended usage of the cluster. Possible values include: "FastProd", - "DenseProd", "DevTest". Default value: "FastProd". - :paramtype cluster_purpose: str or ~azure.mgmt.machinelearningservices.models.ClusterPurpose - :keyword ssl_configuration: SSL configuration. - :paramtype ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration - :keyword aks_networking_configuration: AKS networking configuration for vnet. - :paramtype aks_networking_configuration: - ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration - :keyword load_balancer_type: Load Balancer Type. Possible values include: "PublicIp", - "InternalLoadBalancer". Default value: "PublicIp". - :paramtype load_balancer_type: str or - ~azure.mgmt.machinelearningservices.models.LoadBalancerType - :keyword load_balancer_subnet: Load Balancer Subnet. - :paramtype load_balancer_subnet: str - """ - super(AKSProperties, self).__init__(**kwargs) - self.cluster_fqdn = cluster_fqdn - self.system_services = None - self.agent_count = agent_count - self.agent_vm_size = agent_vm_size - self.cluster_purpose = cluster_purpose - self.ssl_configuration = ssl_configuration - self.aks_networking_configuration = aks_networking_configuration - self.load_balancer_type = load_balancer_type - self.load_balancer_subnet = load_balancer_subnet - - -class AmlCompute(Compute): - """Properties(top level) of AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of AmlCompute. - :vartype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["AmlComputeProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - """ - super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'AmlCompute' # type: str - self.properties = properties - - -class AmlComputeNodeInformation(msrest.serialization.Model): - """Compute node information related to a AmlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_id: ID of the compute node. - :vartype node_id: str - :ivar private_ip_address: Private IP address of the compute node. - :vartype private_ip_address: str - :ivar public_ip_address: Public IP address of the compute node. - :vartype public_ip_address: str - :ivar port: SSH port number of the node. - :vartype port: int - :ivar node_state: State of the compute node. Values are idle, running, preparing, unusable, - leaving and preempted. Possible values include: "idle", "running", "preparing", "unusable", - "leaving", "preempted". - :vartype node_state: str or ~azure.mgmt.machinelearningservices.models.NodeState - :ivar run_id: ID of the Experiment running on the node, if any else null. - :vartype run_id: str - """ - - _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, - } - - _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodeInformation, self).__init__(**kwargs) - self.node_id = None - self.private_ip_address = None - self.public_ip_address = None - self.port = None - self.node_state = None - self.run_id = None - - -class AmlComputeNodesInformation(msrest.serialization.Model): - """Result of AmlCompute Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] - :ivar next_link: The continuation token. - :vartype next_link: str - """ - - _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AmlComputeNodesInformation, self).__init__(**kwargs) - self.nodes = None - self.next_link = None - - -class AmlComputeProperties(msrest.serialization.Model): - """AML Compute properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :vartype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :ivar virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :vartype virtual_machine_image: ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :ivar isolated_network: Network is isolated or not. - :vartype isolated_network: bool - :ivar scale_settings: Scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :ivar user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :vartype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :vartype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :ivar allocation_state: Allocation state of the compute. Possible values are: steady - - Indicates that the compute is not resizing. There are no changes to the number of compute nodes - in the compute in progress. A compute enters this state when it is created and when no - operations are being performed on the compute to change the number of compute nodes. resizing - - Indicates that the compute is resizing; that is, compute nodes are being added to or removed - from the compute. Possible values include: "Steady", "Resizing". - :vartype allocation_state: str or ~azure.mgmt.machinelearningservices.models.AllocationState - :ivar allocation_state_transition_time: The time at which the compute entered its current - allocation state. - :vartype allocation_state_transition_time: ~datetime.datetime - :ivar errors: Collection of errors encountered by various compute nodes during node setup. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar current_node_count: The number of compute nodes currently assigned to the compute. - :vartype current_node_count: int - :ivar target_node_count: The target number of compute nodes for the compute. If the - allocationState is resizing, this property denotes the target node count for the ongoing resize - operation. If the allocationState is steady, this property denotes the target node count for - the previous resize operation. - :vartype target_node_count: int - :ivar node_state_counts: Counts of various node states on the compute. - :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts - :ivar enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :vartype enable_node_public_ip: bool - """ - - _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - } - - def __init__( - self, - *, - os_type: Optional[Union[str, "OsType"]] = "Linux", - vm_size: Optional[str] = None, - vm_priority: Optional[Union[str, "VmPriority"]] = None, - virtual_machine_image: Optional["VirtualMachineImage"] = None, - isolated_network: Optional[bool] = None, - scale_settings: Optional["ScaleSettings"] = None, - user_account_credentials: Optional["UserAccountCredentials"] = None, - subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", - enable_node_public_ip: Optional[bool] = True, - **kwargs - ): - """ - :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: - "Linux". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OsType - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword vm_priority: Virtual Machine priority. Possible values include: "Dedicated", - "LowPriority". - :paramtype vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority - :keyword virtual_machine_image: Virtual Machine image for AML Compute - windows only. - :paramtype virtual_machine_image: - ~azure.mgmt.machinelearningservices.models.VirtualMachineImage - :keyword isolated_network: Network is isolated or not. - :paramtype isolated_network: bool - :keyword scale_settings: Scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - :keyword user_account_credentials: Credentials for an administrator user account that will be - created on each compute node. - :paramtype user_account_credentials: - ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword remote_login_port_public_access: State of the public SSH port. Possible values are: - Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, - else is open all public nodes. It can be default only during cluster creation time, after - creation it will be either enabled or disabled. Possible values include: "Enabled", "Disabled", - "NotSpecified". Default value: "NotSpecified". - :paramtype remote_login_port_public_access: str or - ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess - :keyword enable_node_public_ip: Enable or disable node public IP address provisioning. Possible - values are: Possible values are: true - Indicates that the compute nodes will have public IPs - provisioned. false - Indicates that the compute nodes will have a private endpoint and no - public IPs. - :paramtype enable_node_public_ip: bool - """ - super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = os_type - self.vm_size = vm_size - self.vm_priority = vm_priority - self.virtual_machine_image = virtual_machine_image - self.isolated_network = isolated_network - self.scale_settings = scale_settings - self.user_account_credentials = user_account_credentials - self.subnet = subnet - self.remote_login_port_public_access = remote_login_port_public_access - self.allocation_state = None - self.allocation_state_transition_time = None - self.errors = None - self.current_node_count = None - self.target_node_count = None - self.node_state_counts = None - self.enable_node_public_ip = enable_node_public_ip - - -class AmlUserFeature(msrest.serialization.Model): - """Features enabled for a workspace. - - :ivar id: Specifies the feature ID. - :vartype id: str - :ivar display_name: Specifies the feature name. - :vartype display_name: str - :ivar description: Describes the feature for user experience. - :vartype description: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Specifies the feature ID. - :paramtype id: str - :keyword display_name: Specifies the feature name. - :paramtype display_name: str - :keyword description: Describes the feature for user experience. - :paramtype description: str - """ - super(AmlUserFeature, self).__init__(**kwargs) - self.id = id - self.display_name = display_name - self.description = description - - -class AssignedUser(msrest.serialization.Model): - """A user that can be assigned to a compute instance. - - All required parameters must be populated in order to send to Azure. - - :ivar object_id: Required. User’s AAD Object Id. - :vartype object_id: str - :ivar tenant_id: Required. User’s AAD Tenant Id. - :vartype tenant_id: str - """ - - _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, - } - - _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): - """ - :keyword object_id: Required. User’s AAD Object Id. - :paramtype object_id: str - :keyword tenant_id: Required. User’s AAD Tenant Id. - :paramtype tenant_id: str - """ - super(AssignedUser, self).__init__(**kwargs) - self.object_id = object_id - self.tenant_id = tenant_id - - -class AutoPauseProperties(msrest.serialization.Model): - """Auto pause properties. - - :ivar delay_in_minutes: - :vartype delay_in_minutes: int - :ivar enabled: - :vartype enabled: bool - """ - - _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - delay_in_minutes: Optional[int] = None, - enabled: Optional[bool] = None, - **kwargs - ): - """ - :keyword delay_in_minutes: - :paramtype delay_in_minutes: int - :keyword enabled: - :paramtype enabled: bool - """ - super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = delay_in_minutes - self.enabled = enabled - - -class AutoScaleProperties(msrest.serialization.Model): - """Auto scale properties. - - :ivar min_node_count: - :vartype min_node_count: int - :ivar enabled: - :vartype enabled: bool - :ivar max_node_count: - :vartype max_node_count: int - """ - - _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - } - - def __init__( - self, - *, - min_node_count: Optional[int] = None, - enabled: Optional[bool] = None, - max_node_count: Optional[int] = None, - **kwargs - ): - """ - :keyword min_node_count: - :paramtype min_node_count: int - :keyword enabled: - :paramtype enabled: bool - :keyword max_node_count: - :paramtype max_node_count: int - """ - super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = min_node_count - self.enabled = enabled - self.max_node_count = max_node_count - - -class ClusterUpdateParameters(msrest.serialization.Model): - """AmlCompute update parameters. - - :ivar properties: Properties of ClusterUpdate. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - - _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, - } - - def __init__( - self, - *, - properties: Optional["ScaleSettingsInformation"] = None, - **kwargs - ): - """ - :keyword properties: Properties of ClusterUpdate. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation - """ - super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = properties - - -class Components1D3SwueSchemasComputeresourceAllof1(msrest.serialization.Model): - """Components1D3SwueSchemasComputeresourceAllof1. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - """ - super(Components1D3SwueSchemasComputeresourceAllof1, self).__init__(**kwargs) - self.properties = properties - - -class ComputeInstance(Compute): - """Properties(top level) of ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of ComputeInstance. - :vartype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["ComputeInstanceProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - """ - super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'ComputeInstance' # type: str - self.properties = properties - - -class ComputeInstanceApplication(msrest.serialization.Model): - """Defines an Aml Instance application and its connectivity endpoint URI. - - :ivar display_name: Name of the ComputeInstance application. - :vartype display_name: str - :ivar endpoint_uri: Application' endpoint URI. - :vartype endpoint_uri: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - endpoint_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword display_name: Name of the ComputeInstance application. - :paramtype display_name: str - :keyword endpoint_uri: Application' endpoint URI. - :paramtype endpoint_uri: str - """ - super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = display_name - self.endpoint_uri = endpoint_uri - - -class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): - """Defines all connectivity endpoints and properties for an ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar public_ip_address: Public IP Address of this ComputeInstance. - :vartype public_ip_address: str - :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in - which the compute instance is deployed). - :vartype private_ip_address: str - """ - - _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) - self.public_ip_address = None - self.private_ip_address = None - - -class ComputeInstanceCreatedBy(msrest.serialization.Model): - """Describes information on user who created this ComputeInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_name: Name of the user. - :vartype user_name: str - :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. - :vartype user_org_id: str - :ivar user_id: Uniquely identifies the user within his/her organization. - :vartype user_id: str - """ - - _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ComputeInstanceCreatedBy, self).__init__(**kwargs) - self.user_name = None - self.user_org_id = None - self.user_id = None - - -class ComputeInstanceLastOperation(msrest.serialization.Model): - """The last operation on ComputeInstance. - - :ivar operation_name: Name of the last operation. Possible values include: "Create", "Start", - "Stop", "Restart", "Reimage", "Delete". - :vartype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :ivar operation_time: Time of the last operation. - :vartype operation_time: ~datetime.datetime - :ivar operation_status: Operation status. Possible values include: "InProgress", "Succeeded", - "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", "DeleteFailed". - :vartype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - """ - - _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_name: Optional[Union[str, "OperationName"]] = None, - operation_time: Optional[datetime.datetime] = None, - operation_status: Optional[Union[str, "OperationStatus"]] = None, - **kwargs - ): - """ - :keyword operation_name: Name of the last operation. Possible values include: "Create", - "Start", "Stop", "Restart", "Reimage", "Delete". - :paramtype operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName - :keyword operation_time: Time of the last operation. - :paramtype operation_time: ~datetime.datetime - :keyword operation_status: Operation status. Possible values include: "InProgress", - "Succeeded", "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", - "DeleteFailed". - :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus - """ - super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = operation_name - self.operation_time = operation_time - self.operation_status = operation_status - - -class ComputeInstanceProperties(msrest.serialization.Model): - """Compute Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar vm_size: Virtual Machine Size. - :vartype vm_size: str - :ivar subnet: Virtual network subnet resource ID the compute nodes belong to. - :vartype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :vartype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :ivar ssh_settings: Specifies policy and settings for SSH access. - :vartype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :ivar connectivity_endpoints: Describes all connectivity endpoints available for this - ComputeInstance. - :vartype connectivity_endpoints: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints - :ivar applications: Describes available applications and their endpoints on this - ComputeInstance. - :vartype applications: - list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] - :ivar created_by: Describes information on user who created this ComputeInstance. - :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy - :ivar errors: Collection of errors encountered on this ComputeInstance. - :vartype errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar state: The current state of this ComputeInstance. Possible values include: "Creating", - "CreateFailed", "Deleting", "Running", "Restarting", "JobRunning", "SettingUp", "SetupFailed", - "Starting", "Stopped", "Stopping", "UserSettingUp", "UserSetupFailed", "Unknown", "Unusable". - :vartype state: str or ~azure.mgmt.machinelearningservices.models.ComputeInstanceState - :ivar compute_instance_authorization_type: The Compute Instance Authorization type. Available - values are personal (default). Possible values include: "personal". Default value: "personal". - :vartype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :ivar personal_compute_instance_settings: Settings for a personal compute instance. - :vartype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :ivar setup_scripts: Details of customized scripts to execute for setting up the cluster. - :vartype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :ivar last_operation: The last operation on ComputeInstance. - :vartype last_operation: - ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation - :ivar schedules: The list of schedules to be applied on the compute instance. - :vartype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - """ - - _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - schedules: Optional["ComputeSchedules"] = None, - **kwargs - ): - """ - :keyword vm_size: Virtual Machine Size. - :paramtype vm_size: str - :keyword subnet: Virtual network subnet resource ID the compute nodes belong to. - :paramtype subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :keyword application_sharing_policy: Policy for sharing applications on this compute instance - among users of parent workspace. If Personal, only the creator can access applications on this - compute instance. When Shared, any workspace user can access applications on this instance - depending on his/her assigned role. Possible values include: "Personal", "Shared". Default - value: "Shared". - :paramtype application_sharing_policy: str or - ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy - :keyword ssh_settings: Specifies policy and settings for SSH access. - :paramtype ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings - :keyword compute_instance_authorization_type: The Compute Instance Authorization type. - Available values are personal (default). Possible values include: "personal". Default value: - "personal". - :paramtype compute_instance_authorization_type: str or - ~azure.mgmt.machinelearningservices.models.ComputeInstanceAuthorizationType - :keyword personal_compute_instance_settings: Settings for a personal compute instance. - :paramtype personal_compute_instance_settings: - ~azure.mgmt.machinelearningservices.models.PersonalComputeInstanceSettings - :keyword setup_scripts: Details of customized scripts to execute for setting up the cluster. - :paramtype setup_scripts: ~azure.mgmt.machinelearningservices.models.SetupScripts - :keyword schedules: The list of schedules to be applied on the compute instance. - :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules - """ - super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = vm_size - self.subnet = subnet - self.application_sharing_policy = application_sharing_policy - self.ssh_settings = ssh_settings - self.connectivity_endpoints = None - self.applications = None - self.created_by = None - self.errors = None - self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings - self.setup_scripts = setup_scripts - self.last_operation = None - self.schedules = schedules - - -class ComputeInstanceSshSettings(msrest.serialization.Model): - """Specifies policy and settings for SSH access. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :vartype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :ivar admin_user_name: Describes the admin user name. - :vartype admin_user_name: str - :ivar ssh_port: Describes the port for connecting through SSH. - :vartype ssh_port: int - :ivar admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t - rsa -b 2048" to generate your SSH key pairs. - :vartype admin_public_key: str - """ - - _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, - } - - _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, - } - - def __init__( - self, - *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", - admin_public_key: Optional[str] = None, - **kwargs - ): - """ - :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the - public ssh port is open and accessible according to the VNet/subnet policy if applicable. - Possible values include: "Enabled", "Disabled". Default value: "Disabled". - :paramtype ssh_public_access: str or ~azure.mgmt.machinelearningservices.models.SshPublicAccess - :keyword admin_public_key: Specifies the SSH rsa public key file as a string. Use "ssh-keygen - -t rsa -b 2048" to generate your SSH key pairs. - :paramtype admin_public_key: str - """ - super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = ssh_public_access - self.admin_user_name = None - self.ssh_port = None - self.admin_public_key = admin_public_key - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ComputeResource(Resource, Components1D3SwueSchemasComputeresourceAllof1): - """Machine Learning compute object wrapped into ARM resource envelope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: Compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.Compute - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - *, - properties: Optional["Compute"] = None, - identity: Optional["Identity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - **kwargs - ): - """ - :keyword properties: Compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(ComputeResource, self).__init__(properties=properties, **kwargs) - self.properties = properties - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.system_data = None - self.id = None - self.name = None - self.type = None - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.system_data = None - - -class ComputeSchedules(msrest.serialization.Model): - """The list of schedules to be applied on the computes. - - :ivar compute_start_stop: The list of compute start stop schedules to be applied. - :vartype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - - _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, - } - - def __init__( - self, - *, - compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, - **kwargs - ): - """ - :keyword compute_start_stop: The list of compute start stop schedules to be applied. - :paramtype compute_start_stop: - list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] - """ - super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = compute_start_stop - - -class ComputeStartStopSchedule(msrest.serialization.Model): - """Compute start stop schedule properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Schedule id. - :vartype id: str - :ivar provisioning_status: The current deployment state of schedule. Possible values include: - "Completed", "Provisioning", "Failed". - :vartype provisioning_status: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningStatus - :ivar status: The schedule status. Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :ivar trigger_type: The schedule trigger type. Possible values include: "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :ivar action: The compute power action. Possible values include: "Start", "Stop". - :vartype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :ivar recurrence: The workflow trigger recurrence for ComputeStartStop schedule type. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :ivar cron: The workflow trigger cron for ComputeStartStop schedule type. - :vartype cron: ~azure.mgmt.machinelearningservices.models.Cron - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ScheduleStatus"]] = None, - trigger_type: Optional[Union[str, "TriggerType"]] = None, - action: Optional[Union[str, "ComputePowerAction"]] = None, - recurrence: Optional["Recurrence"] = None, - cron: Optional["Cron"] = None, - **kwargs - ): - """ - :keyword status: The schedule status. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus - :keyword trigger_type: The schedule trigger type. Possible values include: "Recurrence", - "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :keyword action: The compute power action. Possible values include: "Start", "Stop". - :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction - :keyword recurrence: The workflow trigger recurrence for ComputeStartStop schedule type. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.Recurrence - :keyword cron: The workflow trigger cron for ComputeStartStop schedule type. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.Cron - """ - super(ComputeStartStopSchedule, self).__init__(**kwargs) - self.id = None - self.provisioning_status = None - self.status = status - self.trigger_type = trigger_type - self.action = action - self.recurrence = recurrence - self.cron = cron - - -class ContainerResourceRequirements(msrest.serialization.Model): - """The resource requirements for the container (cpu and memory). - - :ivar cpu: The minimum amount of CPU cores to be used by the container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu: float - :ivar cpu_limit: The maximum amount of CPU cores allowed to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype cpu_limit: float - :ivar memory_in_gb: The minimum amount of memory (in GB) to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory_in_gb: float - :ivar memory_in_gb_limit: The maximum amount of memory (in GB) allowed to be used by the - container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :vartype memory_in_gb_limit: float - :ivar gpu: The number of GPU cores in the container. - :vartype gpu: int - :ivar fpga: The number of FPGA PCIE devices exposed to the container. Must be multiple of 2. - :vartype fpga: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'float'}, - 'cpu_limit': {'key': 'cpuLimit', 'type': 'float'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, - 'memory_in_gb_limit': {'key': 'memoryInGBLimit', 'type': 'float'}, - 'gpu': {'key': 'gpu', 'type': 'int'}, - 'fpga': {'key': 'fpga', 'type': 'int'}, - } - - def __init__( - self, - *, - cpu: Optional[float] = None, - cpu_limit: Optional[float] = None, - memory_in_gb: Optional[float] = None, - memory_in_gb_limit: Optional[float] = None, - gpu: Optional[int] = None, - fpga: Optional[int] = None, - **kwargs - ): - """ - :keyword cpu: The minimum amount of CPU cores to be used by the container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu: float - :keyword cpu_limit: The maximum amount of CPU cores allowed to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype cpu_limit: float - :keyword memory_in_gb: The minimum amount of memory (in GB) to be used by the container. More - info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory_in_gb: float - :keyword memory_in_gb_limit: The maximum amount of memory (in GB) allowed to be used by the - container. More info: - https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - :paramtype memory_in_gb_limit: float - :keyword gpu: The number of GPU cores in the container. - :paramtype gpu: int - :keyword fpga: The number of FPGA PCIE devices exposed to the container. Must be multiple of 2. - :paramtype fpga: int - """ - super(ContainerResourceRequirements, self).__init__(**kwargs) - self.cpu = cpu - self.cpu_limit = cpu_limit - self.memory_in_gb = memory_in_gb - self.memory_in_gb_limit = memory_in_gb_limit - self.gpu = gpu - self.fpga = fpga - - -class CosmosDbSettings(msrest.serialization.Model): - """CosmosDbSettings. - - :ivar collections_throughput: The throughput of the collections in cosmosdb database. - :vartype collections_throughput: int - """ - - _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, - } - - def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs - ): - """ - :keyword collections_throughput: The throughput of the collections in cosmosdb database. - :paramtype collections_throughput: int - """ - super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = collections_throughput - - -class Cron(msrest.serialization.Model): - """The workflow trigger cron for ComputeStartStop schedule type. - - :ivar start_time: The start time. - :vartype start_time: str - :ivar time_zone: The time zone. - :vartype time_zone: str - :ivar expression: The cron expression. - :vartype expression: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, - } - - def __init__( - self, - *, - start_time: Optional[str] = None, - time_zone: Optional[str] = None, - expression: Optional[str] = None, - **kwargs - ): - """ - :keyword start_time: The start time. - :paramtype start_time: str - :keyword time_zone: The time zone. - :paramtype time_zone: str - :keyword expression: The cron expression. - :paramtype expression: str - """ - super(Cron, self).__init__(**kwargs) - self.start_time = start_time - self.time_zone = time_zone - self.expression = expression - - -class Databricks(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: Properties of Databricks. - :vartype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["DatabricksProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - """ - super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'Databricks' # type: str - self.properties = properties - - -class DatabricksComputeSecretsProperties(msrest.serialization.Model): - """Properties of Databricks Compute Secrets. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - - -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): - """Secrets related to a Machine Learning compute based on Databricks. - - All required parameters must be populated in order to send to Azure. - - :ivar databricks_access_token: access token for databricks account. - :vartype databricks_access_token: str - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: access token for databricks account. - :paramtype databricks_access_token: str - """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) - self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str - - -class DatabricksProperties(msrest.serialization.Model): - """Properties of Databricks. - - :ivar databricks_access_token: Databricks access token. - :vartype databricks_access_token: str - :ivar workspace_url: Workspace Url. - :vartype workspace_url: str - """ - - _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, - } - - def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - workspace_url: Optional[str] = None, - **kwargs - ): - """ - :keyword databricks_access_token: Databricks access token. - :paramtype databricks_access_token: str - :keyword workspace_url: Workspace Url. - :paramtype workspace_url: str - """ - super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = databricks_access_token - self.workspace_url = workspace_url - - -class DataFactory(Compute): - """A DataFactory compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str - - -class DataLakeAnalytics(Compute): - """A DataLakeAnalytics compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["DataLakeAnalyticsProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties - """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataLakeAnalytics' # type: str - self.properties = properties - - -class DataLakeAnalyticsProperties(msrest.serialization.Model): - """DataLakeAnalyticsProperties. - - :ivar data_lake_store_account_name: DataLake Store Account Name. - :vartype data_lake_store_account_name: str - """ - - _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, - } - - def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs - ): - """ - :keyword data_lake_store_account_name: DataLake Store Account Name. - :paramtype data_lake_store_account_name: str - """ - super(DataLakeAnalyticsProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = data_lake_store_account_name - - -class DiagnoseRequestProperties(msrest.serialization.Model): - """DiagnoseRequestProperties. - - :ivar udr: Setting for diagnosing user defined routing. - :vartype udr: dict[str, any] - :ivar nsg: Setting for diagnosing network security group. - :vartype nsg: dict[str, any] - :ivar resource_lock: Setting for diagnosing resource lock. - :vartype resource_lock: dict[str, any] - :ivar dns_resolution: Setting for diagnosing dns resolution. - :vartype dns_resolution: dict[str, any] - :ivar storage_account: Setting for diagnosing dependent storage account. - :vartype storage_account: dict[str, any] - :ivar key_vault: Setting for diagnosing dependent key vault. - :vartype key_vault: dict[str, any] - :ivar container_registry: Setting for diagnosing dependent container registry. - :vartype container_registry: dict[str, any] - :ivar application_insights: Setting for diagnosing dependent application insights. - :vartype application_insights: dict[str, any] - :ivar others: Setting for diagnosing unclassified category of problems. - :vartype others: dict[str, any] - """ - - _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, - } - - def __init__( - self, - *, - udr: Optional[Dict[str, Any]] = None, - nsg: Optional[Dict[str, Any]] = None, - resource_lock: Optional[Dict[str, Any]] = None, - dns_resolution: Optional[Dict[str, Any]] = None, - storage_account: Optional[Dict[str, Any]] = None, - key_vault: Optional[Dict[str, Any]] = None, - container_registry: Optional[Dict[str, Any]] = None, - application_insights: Optional[Dict[str, Any]] = None, - others: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword udr: Setting for diagnosing user defined routing. - :paramtype udr: dict[str, any] - :keyword nsg: Setting for diagnosing network security group. - :paramtype nsg: dict[str, any] - :keyword resource_lock: Setting for diagnosing resource lock. - :paramtype resource_lock: dict[str, any] - :keyword dns_resolution: Setting for diagnosing dns resolution. - :paramtype dns_resolution: dict[str, any] - :keyword storage_account: Setting for diagnosing dependent storage account. - :paramtype storage_account: dict[str, any] - :keyword key_vault: Setting for diagnosing dependent key vault. - :paramtype key_vault: dict[str, any] - :keyword container_registry: Setting for diagnosing dependent container registry. - :paramtype container_registry: dict[str, any] - :keyword application_insights: Setting for diagnosing dependent application insights. - :paramtype application_insights: dict[str, any] - :keyword others: Setting for diagnosing unclassified category of problems. - :paramtype others: dict[str, any] - """ - super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = udr - self.nsg = nsg - self.resource_lock = resource_lock - self.dns_resolution = dns_resolution - self.storage_account = storage_account - self.key_vault = key_vault - self.container_registry = container_registry - self.application_insights = application_insights - self.others = others - - -class DiagnoseResponseResult(msrest.serialization.Model): - """DiagnoseResponseResult. - - :ivar value: - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseResponseResultValue"] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue - """ - super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = value - - -class DiagnoseResponseResultValue(msrest.serialization.Model): - """DiagnoseResponseResultValue. - - :ivar user_defined_route_results: - :vartype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar network_security_rule_results: - :vartype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar resource_lock_results: - :vartype resource_lock_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar dns_resolution_results: - :vartype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar storage_account_results: - :vartype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar key_vault_results: - :vartype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar container_registry_results: - :vartype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar application_insights_results: - :vartype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :ivar other_results: - :vartype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - - _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - *, - user_defined_route_results: Optional[List["DiagnoseResult"]] = None, - network_security_rule_results: Optional[List["DiagnoseResult"]] = None, - resource_lock_results: Optional[List["DiagnoseResult"]] = None, - dns_resolution_results: Optional[List["DiagnoseResult"]] = None, - storage_account_results: Optional[List["DiagnoseResult"]] = None, - key_vault_results: Optional[List["DiagnoseResult"]] = None, - container_registry_results: Optional[List["DiagnoseResult"]] = None, - application_insights_results: Optional[List["DiagnoseResult"]] = None, - other_results: Optional[List["DiagnoseResult"]] = None, - **kwargs - ): - """ - :keyword user_defined_route_results: - :paramtype user_defined_route_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword network_security_rule_results: - :paramtype network_security_rule_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword resource_lock_results: - :paramtype resource_lock_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword dns_resolution_results: - :paramtype dns_resolution_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword storage_account_results: - :paramtype storage_account_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword key_vault_results: - :paramtype key_vault_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword container_registry_results: - :paramtype container_registry_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword application_insights_results: - :paramtype application_insights_results: - list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - :keyword other_results: - :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] - """ - super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = user_defined_route_results - self.network_security_rule_results = network_security_rule_results - self.resource_lock_results = resource_lock_results - self.dns_resolution_results = dns_resolution_results - self.storage_account_results = storage_account_results - self.key_vault_results = key_vault_results - self.container_registry_results = container_registry_results - self.application_insights_results = application_insights_results - self.other_results = other_results - - -class DiagnoseResult(msrest.serialization.Model): - """Result of Diagnose. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code for workspace setup error. - :vartype code: str - :ivar level: Level of workspace setup error. Possible values include: "Warning", "Error", - "Information". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.DiagnoseResultLevel - :ivar message: Message of workspace setup error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DiagnoseResult, self).__init__(**kwargs) - self.code = None - self.level = None - self.message = None - - -class DiagnoseWorkspaceParameters(msrest.serialization.Model): - """Parameters to diagnose a workspace. - - :ivar value: Value of Parameters. - :vartype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, - } - - def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs - ): - """ - :keyword value: Value of Parameters. - :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties - """ - super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = value - - -class EncryptionProperty(msrest.serialization.Model): - """EncryptionProperty. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. Indicates whether or not the encryption is enabled for the workspace. - Possible values include: "Enabled", "Disabled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :ivar identity: The identity that will be used to access the key vault for encryption at rest. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :ivar key_vault_properties: Required. Customer Key vault properties. - :vartype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :ivar cosmos_db_resource_id: The Bring-Your-Own cosmosdb account that customer brings to store - data. - :vartype cosmos_db_resource_id: str - :ivar storage_account_resource_id: The Bring-Your-Own storage account that customer brings to - store data. - :vartype storage_account_resource_id: str - :ivar search_account_resource_id: The Bring-Your-Own search account that customer brings to - store index. - :vartype search_account_resource_id: str - """ - - _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Union[str, "EncryptionStatus"], - key_vault_properties: "KeyVaultProperties", - identity: Optional["IdentityForCmk"] = None, - cosmos_db_resource_id: Optional[str] = None, - storage_account_resource_id: Optional[str] = None, - search_account_resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword status: Required. Indicates whether or not the encryption is enabled for the - workspace. Possible values include: "Enabled", "Disabled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus - :keyword identity: The identity that will be used to access the key vault for encryption at - rest. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.IdentityForCmk - :keyword key_vault_properties: Required. Customer Key vault properties. - :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties - :keyword cosmos_db_resource_id: The Bring-Your-Own cosmosdb account that customer brings to - store data. - :paramtype cosmos_db_resource_id: str - :keyword storage_account_resource_id: The Bring-Your-Own storage account that customer brings - to store data. - :paramtype storage_account_resource_id: str - :keyword search_account_resource_id: The Bring-Your-Own search account that customer brings to - store index. - :paramtype search_account_resource_id: str - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = status - self.identity = identity - self.key_vault_properties = key_vault_properties - self.cosmos_db_resource_id = cosmos_db_resource_id - self.storage_account_resource_id = storage_account_resource_id - self.search_account_resource_id = search_account_resource_id - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class EstimatedVMPrice(msrest.serialization.Model): - """The estimated price info for using a VM of a particular OS type, tier, etc. - - All required parameters must be populated in order to send to Azure. - - :ivar retail_price: Required. The price charged for using the VM. - :vartype retail_price: float - :ivar os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :vartype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :ivar vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :vartype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - - _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, - } - - _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, - } - - def __init__( - self, - *, - retail_price: float, - os_type: Union[str, "VMPriceOSType"], - vm_tier: Union[str, "VMTier"], - **kwargs - ): - """ - :keyword retail_price: Required. The price charged for using the VM. - :paramtype retail_price: float - :keyword os_type: Required. Operating system type used by the VM. Possible values include: - "Linux", "Windows". - :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType - :keyword vm_tier: Required. The type of the VM. Possible values include: "Standard", - "LowPriority", "Spot". - :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier - """ - super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = retail_price - self.os_type = os_type - self.vm_tier = vm_tier - - -class EstimatedVMPrices(msrest.serialization.Model): - """The estimated price info for using a VM. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_currency: Required. Three lettered code specifying the currency of the VM price. - Example: USD. Possible values include: "USD". - :vartype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :ivar unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :vartype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :ivar values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :vartype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - - _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, - } - - _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, - } - - def __init__( - self, - *, - billing_currency: Union[str, "BillingCurrency"], - unit_of_measure: Union[str, "UnitOfMeasure"], - values: List["EstimatedVMPrice"], - **kwargs - ): - """ - :keyword billing_currency: Required. Three lettered code specifying the currency of the VM - price. Example: USD. Possible values include: "USD". - :paramtype billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency - :keyword unit_of_measure: Required. The unit of time measurement for the specified VM price. - Example: OneHour. Possible values include: "OneHour". - :paramtype unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure - :keyword values: Required. The list of estimated prices for using a VM of a particular OS type, - tier, etc. - :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] - """ - super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = billing_currency - self.unit_of_measure = unit_of_measure - self.values = values - - -class ExternalFQDNResponse(msrest.serialization.Model): - """ExternalFQDNResponse. - - :ivar value: - :vartype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, - } - - def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] - """ - super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = value - - -class FQDNEndpoint(msrest.serialization.Model): - """FQDNEndpoint. - - :ivar domain_name: - :vartype domain_name: str - :ivar endpoint_details: - :vartype endpoint_details: list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[List["FQDNEndpointDetail"]] = None, - **kwargs - ): - """ - :keyword domain_name: - :paramtype domain_name: str - :keyword endpoint_details: - :paramtype endpoint_details: - list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] - """ - super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class FQDNEndpointDetail(msrest.serialization.Model): - """FQDNEndpointDetail. - - :ivar port: - :vartype port: int - """ - - _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): - """ - :keyword port: - :paramtype port: int - """ - super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = port - - -class FQDNEndpoints(msrest.serialization.Model): - """FQDNEndpoints. - - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, - } - - def __init__( - self, - *, - properties: Optional["FQDNEndpointsProperties"] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties - """ - super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = properties - - -class FQDNEndpointsProperties(msrest.serialization.Model): - """FQDNEndpointsProperties. - - :ivar category: - :vartype category: str - :ivar endpoints: - :vartype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[List["FQDNEndpoint"]] = None, - **kwargs - ): - """ - :keyword category: - :paramtype category: str - :keyword endpoints: - :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] - """ - super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class HDInsight(Compute): - """A HDInsight compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: HDInsight compute properties. - :vartype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["HDInsightProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - """ - super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'HDInsight' # type: str - self.properties = properties - - -class HDInsightProperties(msrest.serialization.Model): - """HDInsight compute properties. - - :ivar ssh_port: Port open for ssh connections on the master node of the cluster. - :vartype ssh_port: int - :ivar address: Public IP address of the master node of the cluster. - :vartype address: str - :ivar administrator_account: Admin credentials for master node of the cluster. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword ssh_port: Port open for ssh connections on the master node of the cluster. - :paramtype ssh_port: int - :keyword address: Public IP address of the master node of the cluster. - :paramtype address: str - :keyword administrator_account: Admin credentials for master node of the cluster. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Possible values include: "SystemAssigned", - "SystemAssigned,UserAssigned", "UserAssigned", "None". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType - :ivar user_assigned_identities: The user assigned identities associated with the resource. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: The identity type. Possible values include: "SystemAssigned", - "SystemAssigned,UserAssigned", "UserAssigned", "None". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType - :keyword user_assigned_identities: The user assigned identities associated with the resource. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] - """ - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class IdentityForCmk(msrest.serialization.Model): - """Identity that will be used to access key vault for encryption at rest. - - :ivar user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to - access the customer managed key vault. - :paramtype user_assigned_identity: str - """ - super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity - - -class InstanceTypeSchema(msrest.serialization.Model): - """Instance type schema. - - :ivar node_selector: Node Selector. - :vartype node_selector: dict[str, str] - :ivar resources: Resource requests/limits for this instance type. - :vartype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - - _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, - } - - def __init__( - self, - *, - node_selector: Optional[Dict[str, str]] = None, - resources: Optional["InstanceTypeSchemaResources"] = None, - **kwargs - ): - """ - :keyword node_selector: Node Selector. - :paramtype node_selector: dict[str, str] - :keyword resources: Resource requests/limits for this instance type. - :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources - """ - super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = node_selector - self.resources = resources - - -class InstanceTypeSchemaResources(msrest.serialization.Model): - """Resource requests/limits for this instance type. - - :ivar requests: Resource requests for this instance type. - :vartype requests: dict[str, str] - :ivar limits: Resource limits for this instance type. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, - } - - def __init__( - self, - *, - requests: Optional[Dict[str, str]] = None, - limits: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword requests: Resource requests for this instance type. - :paramtype requests: dict[str, str] - :keyword limits: Resource limits for this instance type. - :paramtype limits: dict[str, str] - """ - super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = requests - self.limits = limits - - -class KeyVaultProperties(msrest.serialization.Model): - """KeyVaultProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption - key is present. - :vartype key_vault_arm_id: str - :ivar key_identifier: Required. Key vault uri to access the encryption key. - :vartype key_identifier: str - :ivar identity_client_id: For future use - The client id of the identity which will be used to - access key vault. - :vartype identity_client_id: str - """ - - _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, - } - - def __init__( - self, - *, - key_vault_arm_id: str, - key_identifier: str, - identity_client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned - encryption key is present. - :paramtype key_vault_arm_id: str - :keyword key_identifier: Required. Key vault uri to access the encryption key. - :paramtype key_identifier: str - :keyword identity_client_id: For future use - The client id of the identity which will be used - to access key vault. - :paramtype identity_client_id: str - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = key_vault_arm_id - self.key_identifier = key_identifier - self.identity_client_id = identity_client_id - - -class KubernetesSchema(msrest.serialization.Model): - """Kubernetes Compute Schema. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - """ - super(KubernetesSchema, self).__init__(**kwargs) - self.properties = properties - - -class Kubernetes(Compute, KubernetesSchema): - """A Machine Learning compute based on Kubernetes Compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar properties: Properties of Kubernetes. - :vartype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - """ - super(Kubernetes, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str - self.compute_location = compute_location - self.provisioning_state = None - self.description = description - self.created_on = None - self.modified_on = None - self.resource_id = resource_id - self.provisioning_errors = None - self.is_attached_compute = None - self.disable_local_auth = disable_local_auth - - -class KubernetesProperties(msrest.serialization.Model): - """Kubernetes properties. - - :ivar relay_connection_string: Relay connection string. - :vartype relay_connection_string: str - :ivar service_bus_connection_string: ServiceBus connection string. - :vartype service_bus_connection_string: str - :ivar extension_principal_id: Extension principal-id. - :vartype extension_principal_id: str - :ivar extension_instance_release_train: Extension instance release train. - :vartype extension_instance_release_train: str - :ivar vc_name: VC name. - :vartype vc_name: str - :ivar namespace: Compute namespace. - :vartype namespace: str - :ivar default_instance_type: Default instance type. - :vartype default_instance_type: str - :ivar instance_types: Instance Type Schema. - :vartype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - - _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - *, - relay_connection_string: Optional[str] = None, - service_bus_connection_string: Optional[str] = None, - extension_principal_id: Optional[str] = None, - extension_instance_release_train: Optional[str] = None, - vc_name: Optional[str] = None, - namespace: Optional[str] = "default", - default_instance_type: Optional[str] = None, - instance_types: Optional[Dict[str, "InstanceTypeSchema"]] = None, - **kwargs - ): - """ - :keyword relay_connection_string: Relay connection string. - :paramtype relay_connection_string: str - :keyword service_bus_connection_string: ServiceBus connection string. - :paramtype service_bus_connection_string: str - :keyword extension_principal_id: Extension principal-id. - :paramtype extension_principal_id: str - :keyword extension_instance_release_train: Extension instance release train. - :paramtype extension_instance_release_train: str - :keyword vc_name: VC name. - :paramtype vc_name: str - :keyword namespace: Compute namespace. - :paramtype namespace: str - :keyword default_instance_type: Default instance type. - :paramtype default_instance_type: str - :keyword instance_types: Instance Type Schema. - :paramtype instance_types: dict[str, - ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] - """ - super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = relay_connection_string - self.service_bus_connection_string = service_bus_connection_string - self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train - self.vc_name = vc_name - self.namespace = namespace - self.default_instance_type = default_instance_type - self.instance_types = instance_types - - -class ListAmlUserFeatureResult(msrest.serialization.Model): - """The List Aml user feature operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML user facing features. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlUserFeature] - :ivar next_link: The URI to fetch the next page of AML user features information. Call - ListNext() with this to fetch the next page of AML user features information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListAmlUserFeatureResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListNotebookKeysResult(msrest.serialization.Model): - """ListNotebookKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_access_key: - :vartype primary_access_key: str - :ivar secondary_access_key: - :vartype secondary_access_key: str - """ - - _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListNotebookKeysResult, self).__init__(**kwargs) - self.primary_access_key = None - self.secondary_access_key = None - - -class ListStorageAccountKeysResult(msrest.serialization.Model): - """ListStorageAccountKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListStorageAccountKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - - -class ListUsagesResult(msrest.serialization.Model): - """The List Usages operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of AML resource usages. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Usage] - :ivar next_link: The URI to fetch the next page of AML resource usage information. Call - ListNext() with this to fetch the next page of AML resource usage information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListUsagesResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ListWorkspaceKeysResult(msrest.serialization.Model): - """ListWorkspaceKeysResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_storage_key: - :vartype user_storage_key: str - :ivar user_storage_resource_id: - :vartype user_storage_resource_id: str - :ivar app_insights_instrumentation_key: - :vartype app_insights_instrumentation_key: str - :ivar container_registry_credentials: - :vartype container_registry_credentials: - ~azure.mgmt.machinelearningservices.models.RegistryListCredentialsResult - :ivar notebook_access_keys: - :vartype notebook_access_keys: - ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - """ - - _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceKeysResult, self).__init__(**kwargs) - self.user_storage_key = None - self.user_storage_resource_id = None - self.app_insights_instrumentation_key = None - self.container_registry_credentials = None - self.notebook_access_keys = None - - -class ListWorkspaceQuotas(msrest.serialization.Model): - """The List WorkspaceQuotasByVMFamily operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Workspace Quotas by VM Family. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ResourceQuota] - :ivar next_link: The URI to fetch the next page of workspace quota information by VM Family. - Call ListNext() with this to fetch the next page of Workspace Quota information. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ListWorkspaceQuotas, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ManagedIdentity(msrest.serialization.Model): - """ManagedIdentity. - - :ivar resource_id: - :vartype resource_id: str - :ivar client_id: - :vartype client_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - client_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: - :paramtype resource_id: str - :keyword client_id: - :paramtype client_id: str - """ - super(ManagedIdentity, self).__init__(**kwargs) - self.resource_id = resource_id - self.client_id = client_id - - -class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ManagedIdentityAuthTypeWorkspaceConnectionProperties, NoneAuthTypeWorkspaceConnectionProperties, PATAuthTypeWorkspaceConnectionProperties, SASAuthTypeWorkspaceConnectionProperties, ServicePrincipalAuthTypeWorkspaceConnectionProperties, UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - } - - _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - metadata: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = category - self.target = target - self.value = value - self.value_format = value_format - self.metadata = metadata - - -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ManagedIdentityAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.ManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - metadata: Optional[Dict[str, Any]] = None, - credentials: Optional["ManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -class NodeStateCounts(msrest.serialization.Model): - """Counts of various compute node states on the amlCompute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar idle_node_count: Number of compute nodes in idle state. - :vartype idle_node_count: int - :ivar running_node_count: Number of compute nodes which are running jobs. - :vartype running_node_count: int - :ivar preparing_node_count: Number of compute nodes which are being prepared. - :vartype preparing_node_count: int - :ivar unusable_node_count: Number of compute nodes which are in unusable state. - :vartype unusable_node_count: int - :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. - :vartype leaving_node_count: int - :ivar preempted_node_count: Number of compute nodes which are in preempted state. - :vartype preempted_node_count: int - """ - - _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, - } - - _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NodeStateCounts, self).__init__(**kwargs) - self.idle_node_count = None - self.running_node_count = None - self.preparing_node_count = None - self.unusable_node_count = None - self.leaving_node_count = None - self.preempted_node_count = None - - -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """NoneAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - metadata: Optional[Dict[str, Any]] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'None' # type: str - - -class NotebookAccessTokenResult(msrest.serialization.Model): - """NotebookAccessTokenResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar notebook_resource_id: - :vartype notebook_resource_id: str - :ivar host_name: - :vartype host_name: str - :ivar public_dns: - :vartype public_dns: str - :ivar access_token: - :vartype access_token: str - :ivar token_type: - :vartype token_type: str - :ivar expires_in: - :vartype expires_in: int - :ivar refresh_token: - :vartype refresh_token: str - :ivar scope: - :vartype scope: str - """ - - _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, - } - - _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NotebookAccessTokenResult, self).__init__(**kwargs) - self.notebook_resource_id = None - self.host_name = None - self.public_dns = None - self.access_token = None - self.token_type = None - self.expires_in = None - self.refresh_token = None - self.scope = None - - -class NotebookPreparationError(msrest.serialization.Model): - """NotebookPreparationError. - - :ivar error_message: - :vartype error_message: str - :ivar status_code: - :vartype status_code: int - """ - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - *, - error_message: Optional[str] = None, - status_code: Optional[int] = None, - **kwargs - ): - """ - :keyword error_message: - :paramtype error_message: str - :keyword status_code: - :paramtype status_code: int - """ - super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = error_message - self.status_code = status_code - - -class NotebookResourceInfo(msrest.serialization.Model): - """NotebookResourceInfo. - - :ivar fqdn: - :vartype fqdn: str - :ivar resource_id: the data plane resourceId that used to initialize notebook component. - :vartype resource_id: str - :ivar notebook_preparation_error: The error that occurs when preparing notebook. - :vartype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, - **kwargs - ): - """ - :keyword fqdn: - :paramtype fqdn: str - :keyword resource_id: the data plane resourceId that used to initialize notebook component. - :paramtype resource_id: str - :keyword notebook_preparation_error: The error that occurs when preparing notebook. - :paramtype notebook_preparation_error: - ~azure.mgmt.machinelearningservices.models.NotebookPreparationError - """ - super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = fqdn - self.resource_id = resource_id - self.notebook_preparation_error = notebook_preparation_error - - -class Operation(msrest.serialization.Model): - """Azure Machine Learning workspace REST API operation. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: Display name of operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - - -class OperationDisplay(msrest.serialization.Model): - """Display name of operation. - - :ivar provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :vartype provider: str - :ivar resource: The resource on which the operation is performed. - :vartype resource: str - :ivar operation: The operation that users can perform. - :vartype operation: str - :ivar description: The description for the operation. - :vartype description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. - :paramtype provider: str - :keyword resource: The resource on which the operation is performed. - :paramtype resource: str - :keyword operation: The operation that users can perform. - :paramtype operation: str - :keyword description: The description for the operation. - :paramtype description: str - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML workspace operations supported by the AML workspace resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Operation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - } - - def __init__( - self, - *, - value: Optional[List["Operation"]] = None, - **kwargs - ): - """ - :keyword value: List of AML workspace operations supported by the AML workspace resource - provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Operation] - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = value - - -class PaginatedComputeResourcesList(msrest.serialization.Model): - """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. - - :ivar value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :vartype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :ivar next_link: A continuation link (absolute URI) to the next page of results in the list. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ComputeResource"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] - :keyword next_link: A continuation link (absolute URI) to the next page of results in the list. - :paramtype next_link: str - """ - super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class Password(msrest.serialization.Model): - """Password. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: - :vartype name: str - :ivar value: - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Password, self).__init__(**kwargs) - self.name = None - self.value = None - - -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """PATAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.PersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'PersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - metadata: Optional[Dict[str, Any]] = None, - credentials: Optional["PersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.PersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -class PersonalAccessToken(msrest.serialization.Model): - """PersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, - } - - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): - """ - :keyword pat: - :paramtype pat: str - """ - super(PersonalAccessToken, self).__init__(**kwargs) - self.pat = pat - - -class PersonalComputeInstanceSettings(msrest.serialization.Model): - """Settings for a personal compute instance. - - :ivar assigned_user: A user explicitly assigned to a personal compute instance. - :vartype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - - _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, - } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs - ): - """ - :keyword assigned_user: A user explicitly assigned to a personal compute instance. - :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser - """ - super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = assigned_user - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - :ivar subnet_arm_id: The ARM identifier for Subnet resource that private endpoint links to. - :vartype subnet_arm_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - self.subnet_arm_id = None - - -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. - :vartype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Possible values include: "Succeeded", "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["Identity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword private_endpoint: The resource of private end point. - :paramtype private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint - :keyword private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :paramtype private_link_service_connection_state: - ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState - """ - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.system_data = None - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = None - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """List of private endpoint connection associated with the specified workspace. - - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateEndpointConnection"]] = None, - **kwargs - ): - """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - """ - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - identity: Optional["Identity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword required_zone_names: The private link resource Private link DNS zone name. - :paramtype required_zone_names: list[str] - """ - super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.system_data = None - self.group_id = None - self.required_members = None - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - """ - :keyword value: Array of private link resources. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] - """ - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :ivar description: The reason for approval/rejection of the connection. - :vartype description: str - :ivar actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :vartype actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, - description: Optional[str] = None, - actions_required: Optional[str] = None, - **kwargs - ): - """ - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - :keyword description: The reason for approval/rejection of the connection. - :paramtype description: str - :keyword actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :paramtype actions_required: str - """ - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = actions_required - - -class QuotaBaseProperties(msrest.serialization.Model): - """The properties for Quota update or retrieval. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - type: Optional[str] = None, - limit: Optional[int] = None, - unit: Optional[Union[str, "QuotaUnit"]] = None, - **kwargs - ): - """ - :keyword id: Specifies the resource ID. - :paramtype id: str - :keyword type: Specifies the resource type. - :paramtype type: str - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword unit: An enum describing the unit of quota measurement. Possible values include: - "Count". - :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = id - self.type = type - self.limit = limit - self.unit = unit - - -class QuotaUpdateParameters(msrest.serialization.Model): - """Quota update parameters. - - :ivar value: The list for update quota. - :vartype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :ivar location: Region of workspace quota to be updated. - :vartype location: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["QuotaBaseProperties"]] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list for update quota. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] - :keyword location: Region of workspace quota to be updated. - :paramtype location: str - """ - super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = value - self.location = location - - -class Recurrence(msrest.serialization.Model): - """The workflow trigger recurrence for ComputeStartStop schedule type. - - :ivar frequency: The recurrence frequency. Possible values include: "NotSpecified", "Second", - "Minute", "Hour", "Day", "Week", "Month", "Year". - :vartype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :ivar interval: The interval. - :vartype interval: int - :ivar start_time: The start time. - :vartype start_time: str - :ivar time_zone: The time zone. - :vartype time_zone: str - :ivar schedule: The recurrence schedule. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - - _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, - } - - def __init__( - self, - *, - frequency: Optional[Union[str, "RecurrenceFrequency"]] = None, - interval: Optional[int] = None, - start_time: Optional[str] = None, - time_zone: Optional[str] = None, - schedule: Optional["RecurrenceSchedule"] = None, - **kwargs - ): - """ - :keyword frequency: The recurrence frequency. Possible values include: "NotSpecified", - "Second", "Minute", "Hour", "Day", "Week", "Month", "Year". - :paramtype frequency: str or ~azure.mgmt.machinelearningservices.models.RecurrenceFrequency - :keyword interval: The interval. - :paramtype interval: int - :keyword start_time: The start time. - :paramtype start_time: str - :keyword time_zone: The time zone. - :paramtype time_zone: str - :keyword schedule: The recurrence schedule. - :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule - """ - super(Recurrence, self).__init__(**kwargs) - self.frequency = frequency - self.interval = interval - self.start_time = start_time - self.time_zone = time_zone - self.schedule = schedule - - -class RecurrenceSchedule(msrest.serialization.Model): - """The recurrence schedule. - - :ivar minutes: The minutes. - :vartype minutes: list[int] - :ivar hours: The hours. - :vartype hours: list[int] - :ivar week_days: The days of the week. - :vartype week_days: list[str or ~azure.mgmt.machinelearningservices.models.DaysOfWeek] - """ - - _attribute_map = { - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'hours': {'key': 'hours', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - } - - def __init__( - self, - *, - minutes: Optional[List[int]] = None, - hours: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "DaysOfWeek"]]] = None, - **kwargs - ): - """ - :keyword minutes: The minutes. - :paramtype minutes: list[int] - :keyword hours: The hours. - :paramtype hours: list[int] - :keyword week_days: The days of the week. - :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.DaysOfWeek] - """ - super(RecurrenceSchedule, self).__init__(**kwargs) - self.minutes = minutes - self.hours = hours - self.week_days = week_days - - -class RegistryListCredentialsResult(msrest.serialization.Model): - """RegistryListCredentialsResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: - :vartype location: str - :ivar username: - :vartype username: str - :ivar passwords: - :vartype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - - _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, - } - - def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs - ): - """ - :keyword passwords: - :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] - """ - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.location = None - self.username = None - self.passwords = passwords - - -class ResourceAutoGenerated(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceAutoGenerated, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ResourceId(msrest.serialization.Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The ID of the resource. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. The ID of the resource. - :paramtype id: str - """ - super(ResourceId, self).__init__(**kwargs) - self.id = id - - -class ResourceName(msrest.serialization.Model): - """The Resource Name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class ResourceQuota(msrest.serialization.Model): - """The quota assigned to a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar name: Name of the resource. - :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResourceQuota, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.name = None - self.limit = None - self.unit = None - - -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """SASAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.SharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'SharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - metadata: Optional[Dict[str, Any]] = None, - credentials: Optional["SharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.SharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -class ScaleSettings(msrest.serialization.Model): - """scale settings for AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar max_node_count: Required. Max number of nodes to use. - :vartype max_node_count: int - :ivar min_node_count: Min number of nodes to use. - :vartype min_node_count: int - :ivar node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :vartype node_idle_time_before_scale_down: ~datetime.timedelta - """ - - _validation = { - 'max_node_count': {'required': True}, - } - - _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_node_count: int, - min_node_count: Optional[int] = 0, - node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_node_count: Required. Max number of nodes to use. - :paramtype max_node_count: int - :keyword min_node_count: Min number of nodes to use. - :paramtype min_node_count: int - :keyword node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. This - string needs to be in the RFC Format. - :paramtype node_idle_time_before_scale_down: ~datetime.timedelta - """ - super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = max_node_count - self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down - - -class ScaleSettingsInformation(msrest.serialization.Model): - """Desired scale settings for the amlCompute. - - :ivar scale_settings: scale settings for AML Compute. - :vartype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - - _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - } - - def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs - ): - """ - :keyword scale_settings: scale settings for AML Compute. - :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings - """ - super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = scale_settings - - -class ScriptReference(msrest.serialization.Model): - """Script reference. - - :ivar script_source: The storage source of the script: inline, workspace. - :vartype script_source: str - :ivar script_data: The location of scripts in the mounted volume. - :vartype script_data: str - :ivar script_arguments: Optional command line arguments passed to the script to run. - :vartype script_arguments: str - :ivar timeout: Optional time period passed to timeout command. - :vartype timeout: str - """ - - _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - } - - def __init__( - self, - *, - script_source: Optional[str] = None, - script_data: Optional[str] = None, - script_arguments: Optional[str] = None, - timeout: Optional[str] = None, - **kwargs - ): - """ - :keyword script_source: The storage source of the script: inline, workspace. - :paramtype script_source: str - :keyword script_data: The location of scripts in the mounted volume. - :paramtype script_data: str - :keyword script_arguments: Optional command line arguments passed to the script to run. - :paramtype script_arguments: str - :keyword timeout: Optional time period passed to timeout command. - :paramtype timeout: str - """ - super(ScriptReference, self).__init__(**kwargs) - self.script_source = script_source - self.script_data = script_data - self.script_arguments = script_arguments - self.timeout = timeout - - -class ScriptsToExecute(msrest.serialization.Model): - """Customized setup scripts. - - :ivar startup_script: Script that's run every time the machine starts. - :vartype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :ivar creation_script: Script that's run only once during provision of the compute. - :vartype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - - _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, - } - - def __init__( - self, - *, - startup_script: Optional["ScriptReference"] = None, - creation_script: Optional["ScriptReference"] = None, - **kwargs - ): - """ - :keyword startup_script: Script that's run every time the machine starts. - :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - :keyword creation_script: Script that's run only once during provision of the compute. - :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference - """ - super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = startup_script - self.creation_script = creation_script - - -class ServiceManagedResourcesSettings(msrest.serialization.Model): - """ServiceManagedResourcesSettings. - - :ivar cosmos_db: The settings for the service managed cosmosdb account. - :vartype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - - _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, - } - - def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs - ): - """ - :keyword cosmos_db: The settings for the service managed cosmosdb account. - :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings - """ - super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = cosmos_db - - -class ServicePrincipal(msrest.serialization.Model): - """ServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs - ): - """ - :keyword client_id: - :paramtype client_id: str - :keyword client_secret: - :paramtype client_secret: str - :keyword tenant_id: - :paramtype tenant_id: str - """ - super(ServicePrincipal, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - self.tenant_id = tenant_id - - -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """ServicePrincipalAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.ServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - metadata: Optional[Dict[str, Any]] = None, - credentials: Optional["ServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = credentials - - -class ServicePrincipalCredentials(msrest.serialization.Model): - """Service principal credentials. - - All required parameters must be populated in order to send to Azure. - - :ivar client_id: Required. Client Id. - :vartype client_id: str - :ivar client_secret: Required. Client secret. - :vartype client_secret: str - """ - - _validation = { - 'client_id': {'required': True}, - 'client_secret': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - client_id: str, - client_secret: str, - **kwargs - ): - """ - :keyword client_id: Required. Client Id. - :paramtype client_id: str - :keyword client_secret: Required. Client secret. - :paramtype client_secret: str - """ - super(ServicePrincipalCredentials, self).__init__(**kwargs) - self.client_id = client_id - self.client_secret = client_secret - - -class SetupScripts(msrest.serialization.Model): - """Details of customized scripts to execute for setting up the cluster. - - :ivar scripts: Customized setup scripts. - :vartype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - - _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, - } - - def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs - ): - """ - :keyword scripts: Customized setup scripts. - :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute - """ - super(SetupScripts, self).__init__(**kwargs) - self.scripts = scripts - - -class SharedAccessSignature(msrest.serialization.Model): - """SharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, - } - - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): - """ - :keyword sas: - :paramtype sas: str - """ - super(SharedAccessSignature, self).__init__(**kwargs) - self.sas = sas - - -class SharedPrivateLinkResource(msrest.serialization.Model): - """SharedPrivateLinkResource. - - :ivar name: Unique name of the private link. - :vartype name: str - :ivar private_link_resource_id: The resource id that private link links to. - :vartype private_link_resource_id: str - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar request_message: Request message. - :vartype request_message: str - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", - "Timeout". - :vartype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - group_id: Optional[str] = None, - request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, - **kwargs - ): - """ - :keyword name: Unique name of the private link. - :paramtype name: str - :keyword private_link_resource_id: The resource id that private link links to. - :paramtype private_link_resource_id: str - :keyword group_id: The private link resource group id. - :paramtype group_id: str - :keyword request_message: Request message. - :paramtype request_message: str - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Possible values include: "Pending", "Approved", "Rejected", - "Disconnected", "Timeout". - :paramtype status: str or - ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus - """ - super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = name - self.private_link_resource_id = private_link_resource_id - self.group_id = group_id - self.request_message = request_message - self.status = status - - -class Sku(msrest.serialization.Model): - """Sku of the resource. - - :ivar name: Name of the sku. - :vartype name: str - :ivar tier: Tier of the sku like Basic or Enterprise. - :vartype tier: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - tier: Optional[str] = None, - **kwargs - ): - """ - :keyword name: Name of the sku. - :paramtype name: str - :keyword tier: Tier of the sku like Basic or Enterprise. - :paramtype tier: str - """ - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - - -class SslConfiguration(msrest.serialization.Model): - """The ssl configuration for scoring. - - :ivar status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus - :ivar cert: Cert data. - :vartype cert: str - :ivar key: Key data. - :vartype key: str - :ivar cname: CNAME of the cert. - :vartype cname: str - :ivar leaf_domain_label: Leaf domain label of public endpoint. - :vartype leaf_domain_label: str - :ivar overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :vartype overwrite_existing_domain: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "SslConfigurationStatus"]] = None, - cert: Optional[str] = None, - key: Optional[str] = None, - cname: Optional[str] = None, - leaf_domain_label: Optional[str] = None, - overwrite_existing_domain: Optional[bool] = None, - **kwargs - ): - """ - :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", - "Enabled", "Auto". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus - :keyword cert: Cert data. - :paramtype cert: str - :keyword key: Key data. - :paramtype key: str - :keyword cname: CNAME of the cert. - :paramtype cname: str - :keyword leaf_domain_label: Leaf domain label of public endpoint. - :paramtype leaf_domain_label: str - :keyword overwrite_existing_domain: Indicates whether to overwrite existing domain label. - :paramtype overwrite_existing_domain: bool - """ - super(SslConfiguration, self).__init__(**kwargs) - self.status = status - self.cert = cert - self.key = key - self.cname = cname - self.leaf_domain_label = leaf_domain_label - self.overwrite_existing_domain = overwrite_existing_domain - - -class SynapseSpark(Compute): - """A SynapseSpark compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = properties - - -class SynapseSparkProperties(msrest.serialization.Model): - """SynapseSparkProperties. - - :ivar auto_scale_properties: Auto scale properties. - :vartype auto_scale_properties: ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :ivar auto_pause_properties: Auto pause properties. - :vartype auto_pause_properties: ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :ivar spark_version: Spark version. - :vartype spark_version: str - :ivar node_count: The number of compute nodes currently assigned to the compute. - :vartype node_count: int - :ivar node_size: Node size. - :vartype node_size: str - :ivar node_size_family: Node size family. - :vartype node_size_family: str - :ivar subscription_id: Azure subscription identifier. - :vartype subscription_id: str - :ivar resource_group: Name of the resource group in which workspace is located. - :vartype resource_group: str - :ivar workspace_name: Name of Azure Machine Learning workspace. - :vartype workspace_name: str - :ivar pool_name: Pool name. - :vartype pool_name: str - """ - - _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, - } - - def __init__( - self, - *, - auto_scale_properties: Optional["AutoScaleProperties"] = None, - auto_pause_properties: Optional["AutoPauseProperties"] = None, - spark_version: Optional[str] = None, - node_count: Optional[int] = None, - node_size: Optional[str] = None, - node_size_family: Optional[str] = None, - subscription_id: Optional[str] = None, - resource_group: Optional[str] = None, - workspace_name: Optional[str] = None, - pool_name: Optional[str] = None, - **kwargs - ): - """ - :keyword auto_scale_properties: Auto scale properties. - :paramtype auto_scale_properties: - ~azure.mgmt.machinelearningservices.models.AutoScaleProperties - :keyword auto_pause_properties: Auto pause properties. - :paramtype auto_pause_properties: - ~azure.mgmt.machinelearningservices.models.AutoPauseProperties - :keyword spark_version: Spark version. - :paramtype spark_version: str - :keyword node_count: The number of compute nodes currently assigned to the compute. - :paramtype node_count: int - :keyword node_size: Node size. - :paramtype node_size: str - :keyword node_size_family: Node size family. - :paramtype node_size_family: str - :keyword subscription_id: Azure subscription identifier. - :paramtype subscription_id: str - :keyword resource_group: Name of the resource group in which workspace is located. - :paramtype resource_group: str - :keyword workspace_name: Name of Azure Machine Learning workspace. - :paramtype workspace_name: str - :keyword pool_name: Pool name. - :paramtype pool_name: str - """ - super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = auto_scale_properties - self.auto_pause_properties = auto_pause_properties - self.spark_version = spark_version - self.node_count = node_count - self.node_size = node_size - self.node_size_family = node_size_family - self.subscription_id = subscription_id - self.resource_group = resource_group - self.workspace_name = workspace_name - self.pool_name = pool_name - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.machinelearningservices.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemService(msrest.serialization.Model): - """A system service running on a compute. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_service_type: The type of this system service. - :vartype system_service_type: str - :ivar public_ip_address: Public IP address. - :vartype public_ip_address: str - :ivar version: The version for this type. - :vartype version: str - """ - - _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(SystemService, self).__init__(**kwargs) - self.system_service_type = None - self.public_ip_address = None - self.version = None - - -class UpdateWorkspaceQuotas(msrest.serialization.Model): - """The properties for update Quota response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar limit: The maximum permitted quota of the resource. - :vartype limit: long - :ivar unit: An enum describing the unit of quota measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit - :ivar status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - limit: Optional[int] = None, - status: Optional[Union[str, "Status"]] = None, - **kwargs - ): - """ - :keyword limit: The maximum permitted quota of the resource. - :paramtype limit: long - :keyword status: Status of update workspace quota. Possible values include: "Undefined", - "Success", "Failure", "InvalidQuotaBelowClusterMinimum", - "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", - "OperationNotEnabledForRegion". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.Status - """ - super(UpdateWorkspaceQuotas, self).__init__(**kwargs) - self.id = None - self.type = None - self.limit = limit - self.unit = None - self.status = status - - -class UpdateWorkspaceQuotasResult(msrest.serialization.Model): - """The result of update workspace quota. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of workspace quota update result. - :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] - :ivar next_link: The URI to fetch the next page of workspace quota update result. Call - ListNext() with this to fetch the next page of Workspace Quota update result. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class Usage(msrest.serialization.Model): - """Describes AML Resource Usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Specifies the resource ID. - :vartype id: str - :ivar aml_workspace_location: Region of the AML workspace in the id. - :vartype aml_workspace_location: str - :ivar type: Specifies the resource type. - :vartype type: str - :ivar unit: An enum describing the unit of usage measurement. Possible values include: "Count". - :vartype unit: str or ~azure.mgmt.machinelearningservices.models.UsageUnit - :ivar current_value: The current usage of the resource. - :vartype current_value: long - :ivar limit: The maximum permitted usage of the resource. - :vartype limit: long - :ivar name: The name of the type of usage. - :vartype name: ~azure.mgmt.machinelearningservices.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Usage, self).__init__(**kwargs) - self.id = None - self.aml_workspace_location = None - self.type = None - self.unit = None - self.current_value = None - self.limit = None - self.name = None - - -class UsageName(msrest.serialization.Model): - """The Usage Names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The name of the resource. - :vartype value: str - :ivar localized_value: The localized name of the resource. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class UserAccountCredentials(msrest.serialization.Model): - """Settings for user account that gets created on each on the nodes of a compute. - - All required parameters must be populated in order to send to Azure. - - :ivar admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :vartype admin_user_name: str - :ivar admin_user_ssh_public_key: SSH public key of the administrator user account. - :vartype admin_user_ssh_public_key: str - :ivar admin_user_password: Password of the administrator user account. - :vartype admin_user_password: str - """ - - _validation = { - 'admin_user_name': {'required': True}, - } - - _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, - } - - def __init__( - self, - *, - admin_user_name: str, - admin_user_ssh_public_key: Optional[str] = None, - admin_user_password: Optional[str] = None, - **kwargs - ): - """ - :keyword admin_user_name: Required. Name of the administrator user account which can be used to - SSH to nodes. - :paramtype admin_user_name: str - :keyword admin_user_ssh_public_key: SSH public key of the administrator user account. - :paramtype admin_user_ssh_public_key: str - :keyword admin_user_password: Password of the administrator user account. - :paramtype admin_user_password: str - """ - super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = admin_user_name - self.admin_user_ssh_public_key = admin_user_ssh_public_key - self.admin_user_password = admin_user_password - - -class UserAssignedIdentity(msrest.serialization.Model): - """User Assigned Identity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the user assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the user assigned identity. - :vartype tenant_id: str - :ivar client_id: The clientId(aka appId) of the user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.client_id = None - - -class UsernamePassword(msrest.serialization.Model): - """UsernamePassword. - - :ivar username: - :vartype username: str - :ivar password: - :vartype password: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - **kwargs - ): - """ - :keyword username: - :paramtype username: str - :keyword password: - :paramtype password: str - """ - super(UsernamePassword, self).__init__(**kwargs) - self.username = username - self.password = password - - -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """UsernamePasswordAuthTypeWorkspaceConnectionProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar auth_type: Required. Authentication type of the connection target.Constant filled by - server. Possible values include: "PAT", "ManagedIdentity", "UsernamePassword", "None", "SAS", - "ServicePrincipal". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar target: - :vartype target: str - :ivar value: Value details of the workspace connection. - :vartype value: str - :ivar value_format: format for the workspace connection value. Possible values include: "JSON". - :vartype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :ivar metadata: Other Metadata that we would like to store with workspace connection. - :vartype metadata: dict[str, any] - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.UsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'UsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - metadata: Optional[Dict[str, Any]] = None, - credentials: Optional["UsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword target: - :paramtype target: str - :keyword value: Value details of the workspace connection. - :paramtype value: str - :keyword value_format: format for the workspace connection value. Possible values include: - "JSON". - :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat - :keyword metadata: Other Metadata that we would like to store with workspace connection. - :paramtype metadata: dict[str, any] - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.UsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = credentials - - -class VirtualMachine(Compute): - """A Machine Learning compute based on Azure Virtual Machines. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar compute_location: Location for the underlying compute. - :vartype compute_location: str - :ivar provisioning_state: The provision state of the cluster. Valid values are Unknown, - Updating, Provisioning, Succeeded, and Failed. Possible values include: "Unknown", "Updating", - "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar description: The description of the Machine Learning compute. - :vartype description: str - :ivar created_on: The time at which the compute was created. - :vartype created_on: ~datetime.datetime - :ivar modified_on: The time at which the compute was last modified. - :vartype modified_on: ~datetime.datetime - :ivar resource_id: ARM resource id of the underlying compute. - :vartype resource_id: str - :ivar provisioning_errors: Errors during provisioning. - :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.ErrorResponse] - :ivar is_attached_compute: Indicating whether the compute was provisioned by user and brought - from outside if true, or machine learning service provisioned it if false. - :vartype is_attached_compute: bool - :ivar disable_local_auth: Opt-out of local authentication and ensure customers can use only MSI - and AAD exclusively for authentication. - :vartype disable_local_auth: bool - :ivar properties: - :vartype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties - """ - - _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'VirtualMachineProperties'}, - } - - def __init__( - self, - *, - compute_location: Optional[str] = None, - description: Optional[str] = None, - resource_id: Optional[str] = None, - disable_local_auth: Optional[bool] = None, - properties: Optional["VirtualMachineProperties"] = None, - **kwargs - ): - """ - :keyword compute_location: Location for the underlying compute. - :paramtype compute_location: str - :keyword description: The description of the Machine Learning compute. - :paramtype description: str - :keyword resource_id: ARM resource id of the underlying compute. - :paramtype resource_id: str - :keyword disable_local_auth: Opt-out of local authentication and ensure customers can use only - MSI and AAD exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties - """ - super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'VirtualMachine' # type: str - self.properties = properties - - -class VirtualMachineImage(msrest.serialization.Model): - """Virtual Machine image for Windows AML Compute. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. Virtual Machine image path. - :vartype id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - """ - :keyword id: Required. Virtual Machine image path. - :paramtype id: str - """ - super(VirtualMachineImage, self).__init__(**kwargs) - self.id = id - - -class VirtualMachineProperties(msrest.serialization.Model): - """VirtualMachineProperties. - - :ivar virtual_machine_size: Virtual Machine size. - :vartype virtual_machine_size: str - :ivar ssh_port: Port open for ssh connections. - :vartype ssh_port: int - :ivar address: Public IP address of the virtual machine. - :vartype address: str - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :ivar is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :vartype is_notebook_instance_compute: bool - """ - - _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, - } - - def __init__( - self, - *, - virtual_machine_size: Optional[str] = None, - ssh_port: Optional[int] = None, - address: Optional[str] = None, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - is_notebook_instance_compute: Optional[bool] = None, - **kwargs - ): - """ - :keyword virtual_machine_size: Virtual Machine size. - :paramtype virtual_machine_size: str - :keyword ssh_port: Port open for ssh connections. - :paramtype ssh_port: int - :keyword address: Public IP address of the virtual machine. - :paramtype address: str - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - :keyword is_notebook_instance_compute: Indicates whether this compute will be used for running - notebooks. - :paramtype is_notebook_instance_compute: bool - """ - super(VirtualMachineProperties, self).__init__(**kwargs) - self.virtual_machine_size = virtual_machine_size - self.ssh_port = ssh_port - self.address = address - self.administrator_account = administrator_account - self.is_notebook_instance_compute = is_notebook_instance_compute - - -class VirtualMachineSecrets(ComputeSecrets): - """Secrets related to a Machine Learning compute based on AKS. - - All required parameters must be populated in order to send to Azure. - - :ivar compute_type: Required. The type of compute.Constant filled by server. Possible values - include: "AKS", "Kubernetes", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", - "HDInsight", "Databricks", "DataLakeAnalytics", "SynapseSpark". - :vartype compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType - :ivar administrator_account: Admin credentials for virtual machine. - :vartype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - - _validation = { - 'compute_type': {'required': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - } - - def __init__( - self, - *, - administrator_account: Optional["VirtualMachineSshCredentials"] = None, - **kwargs - ): - """ - :keyword administrator_account: Admin credentials for virtual machine. - :paramtype administrator_account: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials - """ - super(VirtualMachineSecrets, self).__init__(**kwargs) - self.compute_type = 'VirtualMachine' # type: str - self.administrator_account = administrator_account - - -class VirtualMachineSize(msrest.serialization.Model): - """Describes the properties of a VM size. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the virtual machine size. - :vartype name: str - :ivar family: The family name of the virtual machine size. - :vartype family: str - :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. - :vartype v_cp_us: int - :ivar gpus: The number of gPUs supported by the virtual machine size. - :vartype gpus: int - :ivar os_vhd_size_mb: The OS VHD disk size, in MB, allowed by the virtual machine size. - :vartype os_vhd_size_mb: int - :ivar max_resource_volume_mb: The resource volume size, in MB, allowed by the virtual machine - size. - :vartype max_resource_volume_mb: int - :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. - :vartype memory_gb: float - :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. - :vartype low_priority_capable: bool - :ivar premium_io: Specifies if the virtual machine size supports premium IO. - :vartype premium_io: bool - :ivar estimated_vm_prices: The estimated price information for using a VM. - :vartype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :ivar supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :vartype supported_compute_types: list[str] - """ - - _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - *, - estimated_vm_prices: Optional["EstimatedVMPrices"] = None, - supported_compute_types: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword estimated_vm_prices: The estimated price information for using a VM. - :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices - :keyword supported_compute_types: Specifies the compute types supported by the virtual machine - size. - :paramtype supported_compute_types: list[str] - """ - super(VirtualMachineSize, self).__init__(**kwargs) - self.name = None - self.family = None - self.v_cp_us = None - self.gpus = None - self.os_vhd_size_mb = None - self.max_resource_volume_mb = None - self.memory_gb = None - self.low_priority_capable = None - self.premium_io = None - self.estimated_vm_prices = estimated_vm_prices - self.supported_compute_types = supported_compute_types - - -class VirtualMachineSizeListResult(msrest.serialization.Model): - """The List Virtual Machine size operation response. - - :ivar value: The list of virtual machine sizes supported by AmlCompute. - :vartype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs - ): - """ - :keyword value: The list of virtual machine sizes supported by AmlCompute. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] - """ - super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = value - - -class VirtualMachineSshCredentials(msrest.serialization.Model): - """Admin credentials for virtual machine. - - :ivar username: Username of admin account. - :vartype username: str - :ivar password: Password of admin account. - :vartype password: str - :ivar public_key_data: Public key data. - :vartype public_key_data: str - :ivar private_key_data: Private key data. - :vartype private_key_data: str - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - public_key_data: Optional[str] = None, - private_key_data: Optional[str] = None, - **kwargs - ): - """ - :keyword username: Username of admin account. - :paramtype username: str - :keyword password: Password of admin account. - :paramtype password: str - :keyword public_key_data: Public key data. - :paramtype public_key_data: str - :keyword private_key_data: Private key data. - :paramtype private_key_data: str - """ - super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = username - self.password = password - self.public_key_data = public_key_data - self.private_key_data = private_key_data - - -class Workspace(Resource): - """An object that represents a machine learning workspace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar location: Specifies the location of the resource. - :vartype location: str - :ivar tags: A set of tags. Contains resource tags defined as key/value pairs. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar system_data: System data. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar workspace_id: The immutable id associated with this workspace. - :vartype workspace_id: str - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. This name in mutable. - :vartype friendly_name: str - :ivar key_vault: ARM id of the key vault associated with this workspace. This cannot be changed - once the workspace has been created. - :vartype key_vault: str - :ivar application_insights: ARM id of the application insights associated with this workspace. - This cannot be changed once the workspace has been created. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype container_registry: str - :ivar storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :vartype storage_account: str - :ivar discovery_url: Url for the discovery service to identify regional endpoints for machine - learning experimentation services. - :vartype discovery_url: str - :ivar provisioning_state: The current deployment state of workspace resource. The - provisioningState is to indicate states for resource provisioning. Possible values include: - "Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.ProvisioningState - :ivar encryption: The encryption settings of Azure ML workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :ivar hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :vartype hbi_workspace: bool - :ivar soft_delete_enabled: create a workspace with soft delete capability. Possible values - include: "True", "False". - :vartype soft_delete_enabled: str or - ~azure.mgmt.machinelearningservices.models.SoftDeleteEnabled - :ivar allow_recover_soft_deleted_workspace: Allow a soft deleted workspace to be recovered. - Possible values include: "True", "False". - :vartype allow_recover_soft_deleted_workspace: str or - ~azure.mgmt.machinelearningservices.models.AllowRecoverSoftDeletedWorkspace - :ivar service_provisioned_resource_group: The name of the managed resource group created by - workspace RP in customer subscription if the workspace is CMK workspace. - :vartype service_provisioned_resource_group: str - :ivar private_link_count: Count of private connections in the workspace. - :vartype private_link_count: int - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar allow_public_access_when_behind_vnet: The flag to indicate whether to allow public access - when behind VNet. - :vartype allow_public_access_when_behind_vnet: bool - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. - :vartype private_endpoint_connections: - list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] - :ivar shared_private_link_resources: The list of shared private link resources in this - workspace. - :vartype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :ivar notebook_info: The notebook info of Azure ML workspace. - :vartype notebook_info: ~azure.mgmt.machinelearningservices.models.NotebookResourceInfo - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar tenant_id: The tenant id associated with this workspace. - :vartype tenant_id: str - :ivar storage_hns_enabled: If the storage associated with the workspace has hierarchical - namespace(HNS) enabled. - :vartype storage_hns_enabled: bool - :ivar ml_flow_tracking_uri: The URI associated with this workspace that machine learning flow - must point at to set up tracking. - :vartype ml_flow_tracking_uri: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'soft_delete_enabled': {'key': 'properties.softDeleteEnabled', 'type': 'str'}, - 'allow_recover_soft_deleted_workspace': {'key': 'properties.allowRecoverSoftDeletedWorkspace', 'type': 'str'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["Identity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - key_vault: Optional[str] = None, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - storage_account: Optional[str] = None, - discovery_url: Optional[str] = None, - encryption: Optional["EncryptionProperty"] = None, - hbi_workspace: Optional[bool] = False, - soft_delete_enabled: Optional[Union[str, "SoftDeleteEnabled"]] = None, - allow_recover_soft_deleted_workspace: Optional[Union[str, "AllowRecoverSoftDeletedWorkspace"]] = None, - image_build_compute: Optional[str] = None, - allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - **kwargs - ): - """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword location: Specifies the location of the resource. - :paramtype location: str - :keyword tags: A set of tags. Contains resource tags defined as key/value pairs. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. This name in mutable. - :paramtype friendly_name: str - :keyword key_vault: ARM id of the key vault associated with this workspace. This cannot be - changed once the workspace has been created. - :paramtype key_vault: str - :keyword application_insights: ARM id of the application insights associated with this - workspace. This cannot be changed once the workspace has been created. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - This cannot be changed once the workspace has been created. - :paramtype container_registry: str - :keyword storage_account: ARM id of the storage account associated with this workspace. This - cannot be changed once the workspace has been created. - :paramtype storage_account: str - :keyword discovery_url: Url for the discovery service to identify regional endpoints for - machine learning experimentation services. - :paramtype discovery_url: str - :keyword encryption: The encryption settings of Azure ML workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty - :keyword hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data - collected by the service. - :paramtype hbi_workspace: bool - :keyword soft_delete_enabled: create a workspace with soft delete capability. Possible values - include: "True", "False". - :paramtype soft_delete_enabled: str or - ~azure.mgmt.machinelearningservices.models.SoftDeleteEnabled - :keyword allow_recover_soft_deleted_workspace: Allow a soft deleted workspace to be recovered. - Possible values include: "True", "False". - :paramtype allow_recover_soft_deleted_workspace: str or - ~azure.mgmt.machinelearningservices.models.AllowRecoverSoftDeletedWorkspace - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword allow_public_access_when_behind_vnet: The flag to indicate whether to allow public - access when behind VNet. - :paramtype allow_public_access_when_behind_vnet: bool - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - :keyword shared_private_link_resources: The list of shared private link resources in this - workspace. - :paramtype shared_private_link_resources: - list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.system_data = None - self.workspace_id = None - self.description = description - self.friendly_name = friendly_name - self.key_vault = key_vault - self.application_insights = application_insights - self.container_registry = container_registry - self.storage_account = storage_account - self.discovery_url = discovery_url - self.provisioning_state = None - self.encryption = encryption - self.hbi_workspace = hbi_workspace - self.soft_delete_enabled = soft_delete_enabled - self.allow_recover_soft_deleted_workspace = allow_recover_soft_deleted_workspace - self.service_provisioned_resource_group = None - self.private_link_count = None - self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet - self.public_network_access = public_network_access - self.private_endpoint_connections = None - self.shared_private_link_resources = shared_private_link_resources - self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings - self.primary_user_assigned_identity = primary_user_assigned_identity - self.tenant_id = None - self.storage_hns_enabled = None - self.ml_flow_tracking_uri = None - - -class WorkspaceConnectionPropertiesV2BasicResource(ResourceAutoGenerated): - """WorkspaceConnectionPropertiesV2BasicResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - :ivar properties: Required. - :vartype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, - } - - def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs - ): - """ - :keyword properties: Required. - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 - """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = properties - - -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): - """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: - :vartype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - :ivar next_link: - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, - **kwargs - ): - """ - :keyword value: - :paramtype value: - list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] - """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class WorkspaceListResult(msrest.serialization.Model): - """The result of a request to list machine learning workspaces. - - :ivar value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :vartype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :ivar next_link: The URI that can be used to request the next list of machine learning - workspaces. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Workspace"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the - nextLink field should be used to request the next list of machine learning workspaces. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.Workspace] - :keyword next_link: The URI that can be used to request the next list of machine learning - workspaces. - :paramtype next_link: str - """ - super(WorkspaceListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class WorkspaceUpdateParameters(msrest.serialization.Model): - """The parameters for updating a machine learning workspace. - - :ivar tags: A set of tags. The resource tags for the machine learning workspace. - :vartype tags: dict[str, str] - :ivar sku: The sku of the workspace. - :vartype sku: ~azure.mgmt.machinelearningservices.models.Sku - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity - :ivar description: The description of this workspace. - :vartype description: str - :ivar friendly_name: The friendly name for this workspace. - :vartype friendly_name: str - :ivar image_build_compute: The compute name for image build. - :vartype image_build_compute: str - :ivar service_managed_resources_settings: The service managed resource settings. - :vartype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :ivar primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :vartype primary_user_assigned_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - identity: Optional["Identity"] = None, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. The resource tags for the machine learning workspace. - :paramtype tags: dict[str, str] - :keyword sku: The sku of the workspace. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity - :keyword description: The description of this workspace. - :paramtype description: str - :keyword friendly_name: The friendly name for this workspace. - :paramtype friendly_name: str - :keyword image_build_compute: The compute name for image build. - :paramtype image_build_compute: str - :keyword service_managed_resources_settings: The service managed resource settings. - :paramtype service_managed_resources_settings: - ~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings - :keyword primary_user_assigned_identity: The user assigned identity resource id that represents - the workspace identity. - :paramtype primary_user_assigned_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Possible - values include: "Enabled", "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess - """ - super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.sku = sku - self.identity = identity - self.description = description - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py deleted file mode 100644 index 45a1d6fd6e25..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._usages_operations import UsagesOperations -from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations -from ._quotas_operations import QuotasOperations -from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._workspace_features_operations import WorkspaceFeaturesOperations - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py deleted file mode 100644 index 30ab6efbffcc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,1418 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - underlying_resource_action = kwargs.pop('underlying_resource_action') # type: Union[str, "_models.UnderlyingResourceAction"] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - query_parameters['underlyingResourceAction'] = _SERIALIZER.query("underlying_resource_action", underlying_resource_action, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_nodes_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_start_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_stop_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_restart_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class ComputeOperations(object): - """ComputeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PaginatedComputeResourcesList"] - """Gets computes in specified workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PaginatedComputeResourcesList or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are - not returned - use 'keys' nested resource to get them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ComputeResource') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ComputeResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Creates or updates compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify - that it does not exist yet. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Payload with Machine Learning compute definition. - :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - parameters, # type: "_models.ClusterUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ComputeResource"] - """Updates properties of a compute. This call will overwrite a compute if it exists. This is a - nonrecoverable operation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param parameters: Additional parameters for cluster update. - :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ComputeResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - underlying_resource_action, # type: Union[str, "_models.UnderlyingResourceAction"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes specified Machine Learning compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the - underlying compute from workspace if 'Detach'. - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - underlying_resource_action=underlying_resource_action, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - - @distributed_trace - def list_nodes( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AmlComputeNodesInformation"] - """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AmlComputeNodesInformation or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self.list_nodes.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_nodes_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) - list_of_elem = deserialized.nodes - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ComputeSecrets" - """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComputeSecrets, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComputeSecrets', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore - - - def _start_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_start_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self._start_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - - - @distributed_trace - def begin_start( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a start action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - - def _stop_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_stop_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self._stop_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - - - @distributed_trace - def begin_stop( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a stop action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - - def _restart_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_restart_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - template_url=self._restart_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore - - - @distributed_trace - def begin_restart( - self, - resource_group_name, # type: str - workspace_name, # type: str - compute_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Posts a restart action to a compute instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param compute_name: Name of the Azure Machine Learning compute. - :type compute_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._restart_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py deleted file mode 100644 index 34c6c0e2ceba..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.MachineLearningServices/operations') - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available Azure Machine Learning Workspaces REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index ca6c75b762ca..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - resource_group_name, # type: str - workspace_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] - """List all the private endpoint connections associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Gets the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - properties, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" - """Update the state of specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. - :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(properties, 'PrivateEndpointConnection') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes the specified private endpoint connection associated with the workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the workspace. - :type private_endpoint_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index 65e829d9c144..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourceListResult" - """Gets the private link resources that need to be created for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkResourceListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py deleted file mode 100644 index fdd7cd4d18a5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,254 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_update_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas') - path_format_arguments = { - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class QuotasOperations(object): - """QuotasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def update( - self, - location, # type: str - parameters, # type: "_models.QuotaUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateWorkspaceQuotasResult" - """Update quota for each VM family in workspace. - - :param location: The location for update quota is queried. - :type location: str - :param parameters: Quota update parameters. - :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateWorkspaceQuotasResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') - - request = build_update_request( - location=location, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore - - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListWorkspaceQuotas"] - """Gets the currently assigned Workspace Quotas based on VMFamily. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py deleted file mode 100644 index 853aaf224112..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,159 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - location, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListUsagesResult"] - """Gets the current usage information as well as limits for AML resources for given subscription - and location. - - :param location: The location for which resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListUsagesResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 5a52be426175..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - location, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes') - path_format_arguments = { - "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class VirtualMachineSizesOperations(object): - """VirtualMachineSizesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualMachineSizeListResult" - """Returns supported VM Sizes in a location. - - :param location: The location upon which virtual-machine-sizes is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualMachineSizeListResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 8f19b3acf95d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,478 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_create_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - if target is not None: - query_parameters['target'] = _SERIALIZER.query("target", target, 'str') - if category is not None: - query_parameters['category'] = _SERIALIZER.query("category", category, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceConnectionsOperations(object): - """WorkspaceConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def create( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - parameters, # type: "_models.WorkspaceConnectionPropertiesV2BasicResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """create. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :param parameters: The object for creating or updating a new workspace connection. - :type parameters: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') - - request = build_create_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - content_type=content_type, - json=_json, - template_url=self.create.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.WorkspaceConnectionPropertiesV2BasicResource" - """get. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - - - @distributed_trace - def delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """delete. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param connection_name: Friendly name of the workspace connection. - :type connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - connection_name=connection_name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - target=None, # type: Optional[str] - category=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - """list. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param target: Target of the workspace connection. - :type target: str - :param category: Category of the workspace connection. - :type category: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - target=target, - category=category, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - target=target, - category=category, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 1c141bf3faf4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class WorkspaceFeaturesOperations(object): - """WorkspaceFeaturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListAmlUserFeatureResult"] - """Lists all enabled features for a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListAmlUserFeatureResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index 964287fe6c64..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1720 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import functools -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_diagnose_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_resync_keys_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - skip = kwargs.pop('skip', None) # type: Optional[str] - - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_notebook_access_token_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_prepare_notebook_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_storage_account_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_notebook_keys_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_outbound_network_dependencies_endpoints_request( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = "2022-01-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -# fmt: on -class WorkspacesOperations(object): - """WorkspacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Workspace" - """Gets the properties of the specified machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workspace, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Workspace') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.Workspace" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Creates or updates a workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for creating or updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a machine learning workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') - - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters, # type: "_models.WorkspaceUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Workspace"] - """Updates a machine learning workspace with the specified parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameters for updating a machine learning workspace. - :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Workspace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - skip=skip, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore - - def _diagnose_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') - else: - _json = None - - request = build_diagnose_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self._diagnose_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - - - @distributed_trace - def begin_diagnose( - self, - resource_group_name, # type: str - workspace_name, # type: str - parameters=None, # type: Optional["_models.DiagnoseWorkspaceParameters"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.DiagnoseResponseResult"] - """Diagnose workspace setup issue. - - Diagnose workspace setup issue. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: The parameter of diagnosing workspace health. - :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either DiagnoseResponseResult or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._diagnose_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListWorkspaceKeysResult" - """Lists all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListWorkspaceKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore - - - def _resync_keys_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_resync_keys_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self._resync_keys_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - - - @distributed_trace - def begin_resync_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resync all the keys associated with this workspace. This includes keys for the storage account, - app insights and password for container registry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._resync_keys_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - - @distributed_trace - def list_by_subscription( - self, - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.WorkspaceListResult"] - """Lists all the available machine learning workspaces under the specified subscription. - - :param skip: Continuation token for pagination. - :type skip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - skip=skip, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - skip=skip, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore - - @distributed_trace - def list_notebook_access_token( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NotebookAccessTokenResult" - """return notebook access token and refresh token. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NotebookAccessTokenResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_notebook_access_token_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_notebook_access_token.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore - - - def _prepare_notebook_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_prepare_notebook_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self._prepare_notebook_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - - - @distributed_trace - def begin_prepare_notebook( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NotebookResourceInfo"] - """Prepare a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._prepare_notebook_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - - @distributed_trace - def list_storage_account_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListStorageAccountKeysResult" - """List storage account keys of a workspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListStorageAccountKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_storage_account_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_storage_account_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore - - - @distributed_trace - def list_notebook_keys( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ListNotebookKeysResult" - """List keys of a notebook. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListNotebookKeysResult, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_notebook_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_notebook_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore - - - @distributed_trace - def list_outbound_network_dependencies_endpoints( - self, - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExternalFQDNResponse" - """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) - programmatically. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalFQDNResponse, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_outbound_network_dependencies_endpoints_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py index 58d980bccf09..8cbb1a3ba7e3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py @@ -8,20 +8,22 @@ from typing import Any, Dict, List, Optional, Type, Union from azure.ai.ml._azure_environments import _get_active_directory_url_from_metadata -from azure.ai.ml._restclient.v2022_01_01_preview.models import Identity as RestIdentityConfiguration -from azure.ai.ml._restclient.v2022_01_01_preview.models import ManagedIdentity as RestWorkspaceConnectionManagedIdentity -from azure.ai.ml._restclient.v2022_01_01_preview.models import ( - PersonalAccessToken as RestWorkspaceConnectionPersonalAccessToken, +from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedServiceIdentity as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import ( + WorkspaceConnectionManagedIdentity as RestWorkspaceConnectionManagedIdentity, +) +from azure.ai.ml._restclient.arm_ml_service.models import ( + WorkspaceConnectionPersonalAccessToken as RestWorkspaceConnectionPersonalAccessToken, ) -from azure.ai.ml._restclient.v2022_01_01_preview.models import ( - ServicePrincipal as RestWorkspaceConnectionServicePrincipal, +from azure.ai.ml._restclient.arm_ml_service.models import ( + WorkspaceConnectionServicePrincipal as RestWorkspaceConnectionServicePrincipal, ) -from azure.ai.ml._restclient.v2022_01_01_preview.models import ( - SharedAccessSignature as RestWorkspaceConnectionSharedAccessSignature, +from azure.ai.ml._restclient.arm_ml_service.models import ( + WorkspaceConnectionSharedAccessSignature as RestWorkspaceConnectionSharedAccessSignature, ) -from azure.ai.ml._restclient.v2022_01_01_preview.models import UserAssignedIdentity as RestUserAssignedIdentity -from azure.ai.ml._restclient.v2022_01_01_preview.models import ( - UsernamePassword as RestWorkspaceConnectionUsernamePassword, +from azure.ai.ml._restclient.v2022_10_01_preview.models import UserAssignedIdentity as RestUserAssignedIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ( + WorkspaceConnectionUsernamePassword as RestWorkspaceConnectionUsernamePassword, ) from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedServiceIdentity as RestManagedServiceIdentityConfiguration, diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index b5f9b57e49bb..fdf164978dc6 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -243,7 +243,7 @@ def mock_aml_services_2022_10_01(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2022_01_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2022_01_01_preview") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture diff --git a/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_operations.py b/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_operations.py index 385bf17989d3..52fbca474590 100644 --- a/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_operations.py +++ b/sdk/ml/azure-ai-ml/tests/connection/unittests/test_connection_operations.py @@ -4,7 +4,7 @@ import pytest from azure.ai.ml import load_connection -from azure.ai.ml._restclient.v2022_01_01_preview.models import ConnectionCategory +from azure.ai.ml._restclient.arm_ml_service.models import ConnectionCategory from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope from azure.ai.ml._utils.utils import camel_to_snake from azure.ai.ml.entities import PatTokenConfiguration, WorkspaceConnection